I need help in a maximization problem(finding the optimal investment portfolio).
[![enter image description here](https://i.stack.imgur.com/iVge7.png)](https://i.stack.imgur.com/iVge7.png)
where $R\_s$ and $\Phi$ are $n$ by $1$, with other variables being scalars.

$C^s$ is consumption (or wealth) of an investor, $R\_s$ (or $R$) is the return rates of risky assets while $R\_f$ is the return rate of a risk-free asset(say government bond), $\Phi$ is the quantities of risky assets, $\phi\_f$ is the quantity of the risk-free asset, $\omega$ is the quantity of all the assets(so $\phi\_f+\Phi' \cdot 1=\omega$), and $u(\cdot)$ is the investor's utility function.

The solution to this problem gives the following first order condition(FOC) i.e. taking derivative w.r.t. $\Phi$ (assuming integration and differentiation can be exchanged):

[![enter image description here](https://i.stack.imgur.com/koeCv.png)](https://i.stack.imgur.com/koeCv.png)

But there's actually a constraint: $\phi\_f+\Phi' \cdot 1=\omega$, so I tried Lagrange but couldn't get the same result:
$$L(\Phi, \lambda)=E[u(c)]+\lambda(\omega-\phi\_f-\Phi' \cdot 1 )$$ with FOCs:
$$\partial L/\partial \Phi =E[u'(c)(R-1\cdot R\_f)]-\lambda \cdot 1=0$$
$$\partial L/\partial \lambda =\omega-\phi\_f-\Phi' \cdot 1 =0$$
I couldn't get the same result from above. To have the result in the solution I must have $\lambda=0$ but I'm not sure in what cases it can hold. Please let me know which parts I did wrong.