# How to simplify square of a Trigonometric function?

I have this expression

$$a^4 Sin[\phi/2]^4 + 1/2 a^2 b^2 Sin[\phi]^2 + b^4 Cos[\phi/2]^4$$.

I expect to get a simple form

$$(a^2 Sin[\phi/2]^2 + b^2 Cos[\phi/2]^2)^2$$.

However mathematica obtain following expression

short1 = FullSimplify[ a^4 Sin[\[Phi]/2]^4 + 1/2 a^2 b^2 Sin[\[Phi]]^2 + b^4 Cos[\[Phi]/2]^4]

1/4 (a^2 + b^2 + (-a^2 + b^2) Cos[\[Phi]])^2.


Anyone know how to solve this problem?

• you can obtain the desired output with FullSimplify[ a^4 Sin[\[Phi]/2]^4 + 1/2 a^2 b^2 Sin[\[Phi]]^2 + b^4 Cos[\[Phi]/2]^4 /. \[Phi] -> 2 \[Phi] // TrigFactor] /. \[Phi] -> \[Phi]/2. Commented May 25, 2021 at 9:30
• Thanks, it works. But why we have to transform $\phi/2$ to $\phi$ first? Commented May 25, 2021 at 9:58
• Perhaps the accepted answer here mathematica.stackexchange.com/questions/23484/… is useful
– user49048
Commented May 25, 2021 at 10:04
• Maybe the Simplify tries to expand Phi/2...Another way without angle replacement is a^4 Sin[\[Phi]/2]^4 + 1/2 a^2 b^2 Sin[\[Phi]]^2 + b^4 Cos[\[Phi]/2]^4 // TrigFactor // Expand // Factor Commented May 25, 2021 at 11:04
• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. Commented May 25, 2021 at 13:43

expr = a^4 Sin[\[Phi]/2]^4 + 1/2 a^2 b^2 Sin[\[Phi]]^2 +

Factor[expr /. Sin[\[Phi]] -> 2 Sin[\[Phi]/2]*Cos[\[Phi]/2]]