# Solving multivariable equation after setting partial derivative to zero

I have a real-valued function of four variables, namely $$L[\phi, m0, m1, m2]$$. I am interested in taking the partial derivative $$\partial_{\phi}L$$ thereof and setting the partial derivative to zero, that is $$\partial_{\phi}L = 0$$. Then solving for $$\phi \in [0,2\pi]$$ in terms of $$m0, m1, m2 \in \mathbb{N}_{0}$$. I have reached the point in the attached code where I have generated the partial derivative $$\partial_{\phi}L$$, but I am having difficulty setting the partial derivative to zero and getting an analytic expression for $$\phi$$ in terms of the other variables $$m0,~m1$$ and $$m2$$. Please advise if there is a clear way of doing this analytically and numerically.

    P1[ϕ_] :=
2^-4 ((E^(I*(ϕ/2)) + E^(-I*(ϕ/2))) (E^(I*(-(ϕ/2))) + E^(I*(ϕ/2))))^2;
P2[ϕ_] :=
2^-3 (E^(I*(ϕ)) - E^(-I*(ϕ))) (E^(I*(-ϕ)) - E^(I*(ϕ)));
P3[ϕ_] :=
2^-4 ((E^(I*(ϕ/2)) - E^(-I*(ϕ/2))) (E^(I*(-(ϕ/2))) - E^(I*(ϕ/2))))^2;

L[ϕ_, m0_, m1_, m2_] := ((P1[ϕ])^m0)*((P2[ϕ])^m1)*((P3[ϕ])^m2)

Refine[Simplify[P1[ϕ] + P2[ϕ] + P3[ϕ]], ϕ ∈ Reals]

Refine[Simplify[L[ϕ, m0, m1, m2]], ϕ ∈ Reals]

DL[ϕ_, m0_, m1_, m2_] := D[Refine[Simplify[L[ϕ, m0, m1, m2]], ϕ ∈ Reals] , ϕ]

Simplify[DL[ϕ, m0, m1, m2]]


Just a note that the function $$L[\phi, m0, m1, m2]$$ is defined in terms of probabilities $$P1, P2$$ and $$P3$$, hence it has a real-valued output for any $$\phi \in \mathbb{R}$$.

• (1) Use cosines and sines instead of complex exponentials. (2) Optimize the log of L. Mar 9 at 15:36
• (3) And link to/from the Wolfram Community cross-post. Mar 10 at 22:29

## 1 Answer

1. The functions used to define L are themselves undefined here.
2. Don't begin user-defined names with capital letters.
3. Use D to partially differentiate and expression with respect to its symbols.