Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a large expression containing many terms like this:

Sin[1/2 ArcTan[(2 Log[5])/(Log[5]^2 - 2)]]

Sin[1/2 ArcTan[(2 Log[5])/(Log[5]^2 - 2)]]

where a trig function is invoked on a rational multiple of an inverse trig function.

I want to expand trig functions such that this term turns into:

Sqrt[1/2 (1 - Sqrt[1 - (4 Log[5]^2)/(4 + Log[5]^4)])]

Sqrt[1/2 (1 - Sqrt[1 - (4 Log[5]^2)/(4 + Log[5]^4)])]

It is tedious to manually convert all such terms, so I am looking for a function that is able to do this automatically. Could you help me with it?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Try this one

Sin[1/2 ArcTan[(2 Log[5])/(-2 + Log[5]^2)]] // FunctionExpand

enter image description here

Another approach is to apply your own rules. You just need to get rid of the rational between the trig function and the inverse trig function. For example

Sin[1/2 ArcTan[(2 Log[5])/(-2 + Log[5]^2)]] /. 
   Sin[1/2 x_] :> Sqrt[1/2 (1 - Cos[x])] // FullSimplify

enter image description here

Verification

% // N
Sin[1/2 ArcTan[(2 Log[5])/(-2 + Log[5]^2)]] // N

0.640166

0.640166

share|improve this answer
add comment

You can use FullSimplify and play with the ComplexityFunction Option until you obtain a satisfactory result. For example: Let's define our function in terms of LeafCount

 c[n_][e_] := n Count[e, _Sin | _ArcTan, Infinity] + LeafCount[e]

Then:

FullSimplify[Sin[1/2 ArcTan[(2 Log[5])/(Log[5]^2 - 2)]], 
   ComplexityFunction -> c[#]] & /@ Range[40, 60, 4]

Which gives:

{I Sinh[1/4 (Log[1 - (I Log[25])/(-2 + Log[5]^2)] - Log[1 + (I Log[25])/(-2 + Log[5]^2)])],

I Sinh[1/4 (Log[1 - (I Log[25])/(-2 + Log[5]^2)] - Log[1 + (I Log[25])/(-2 + Log[5]^2)])],

I Sinh[1/4 (Log[1 - (I Log[25])/(-2 + Log[5]^2)] - Log[1 + (I Log[25])/(-2 + Log[5]^2)])],

I Sinh[1/4 (Log[1 - (I Log[25])/(-2 + Log[5]^2)] - Log[1 + (I Log[25])/(-2 + Log[5]^2)])],

Log[5] Sqrt[2/( 4 + Log[5]^4 - 2 Sqrt[4 + Log[5]^4] + Log[5]^2 Sqrt[4 + Log[5]^4])],

Log[5] Sqrt[2/( 4 + Log[5]^4 - 2 Sqrt[4 + Log[5]^4] + Log[5]^2 Sqrt[4 + Log[5]^4])]}

Where the last 2 answers are the same as that obtained from FunctionExpand. Only this one is more flexible.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.