Optimal Weight - Portfolio Management

In PM, once we calculate the optimal level of active risk, we can come up with the optimal weights for our actively managed portfolio and our portfolio benchmark. As per the book, the formula for the optimal weight of the actively managed portfolio is optimal active risk./active risk.How did we come up with this formula?

I tried to come up with my own formula where the optimal weight should be:
Risk of our portfolio= weight in actively managed portfolio * optimal active risk+ weight in the benchmark*risk of the benchmark. However, I dont get the correct answer.

Can someone please tell me what I am doing wrong here?