# Simplify trigonometric equation knowing that $\sin(a)=n \sin(b)$

I was working on a problem involving trigonometry. I used Mathematica to help me in solving it. I ended up with this formula:

-(1/R) Csc[a - 2 b] (R Cos[a - 2 b] - R (Cos[a - 2 b] - Cot[2 a - 2 b] Sin[a - 2 b]))*
(-R + R Sin[a - 2 b] - (R^2 Cos[a - 2 b] Sin[a - 2 b])/(R Cos[a - 2 b] -
R (Cos[a - 2 b] - Cot[2 a - 2 b] Sin[a - 2 b])))


And I know that $\sin a = n\times\sin b$ where $n$ is a real number. After this I expanded the formula using TrigExpand that generated a very large output. I want to know how I can replace all trigonometric functions that contains $b$ so at the end I have a formula that contains just $n$ and trigonometric functions that have $a$.

• I'm sorry I broke the expression when editing your post, now it's fixed. I will delete my comments. Although I now wonder why you feel the need to use TrigExpand while it works fine without. – Öskå Nov 13 '14 at 14:46

## 2 Answers

Try this:

This makes everything b-dependent:

 Map[TrigExpand, expr] /. {Sin[a] -> n*Sin[b],
Cos[a] -> Sqrt[1 - n^2*Sin[b]^2]} // Simplify

(*  -((R Csc[b] (n - n^3 Cos[2 b] +
Cos[b] Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] +
Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Cos[3 b] -
n^2 Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Cos[3 b] - 3 n Cos[4 b] +
2 n^3 Cos[4 b] +
n^2 Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Cos[5 b] - n^3 Cos[6 b] +
n^2 Sin[b] + n Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] Sin[2 b] -
n^2 Sin[3 b]))/(2 (n Cos[2 b] -
Cos[b] Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]]) ((-2 + n^2) Cos[b] +
n (Cos[2 b] Sqrt[4 - 2 n^2 + 2 n^2 Cos[2 b]] - n Cos[3 b]))))  *)


The same to make it a-dependent:

    Map[TrigExpand, expr] /. {Sin[b] -> n^-1*Sin[a],
Cos[b] -> Sqrt[1 - n^-2*Sin[a]^2]} // Simplify

(*   (R Csc[a] (-1 + (3 - 4 n^2 + 2 n^4) Cos[2 a] -
Sqrt n Cos[a] Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] +
2 Sqrt n Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] Cos[3 a] -
2 Sqrt n^3 Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] Cos[3 a] -
3 Cos[4 a] + 4 n^2 Cos[4 a] -
Sqrt n Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] Cos[5 a] +
Cos[6 a] - 3 n^2 Sin[a] + 2 n^4 Sin[a] -
Sqrt n^3 Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] Sin[2 a] +
n^2 Sin[3 a]))/(2 (-1 + n^2 + Cos[2 a] -
Sqrt n Cos[a] Sqrt[(-1 + 2 n^2 + Cos[2 a])/
n^2]) ((-1 + 2 n^2) Cos[a] -
Sqrt n Cos[2 a] Sqrt[(-1 + 2 n^2 + Cos[2 a])/n^2] + Cos[3 a]))    *)


Have fun!

expr = -(1/R) Csc[
a - 2 b] (R Cos[a - 2 b] -
R (Cos[a - 2 b] - Cot[2 a - 2 b] Sin[a - 2 b]))*(-R +
R Sin[a -
2 b] - (R^2 Cos[a - 2 b] Sin[a - 2 b])/(R Cos[a - 2 b] -
R (Cos[a - 2 b] - Cot[2 a - 2 b] Sin[a - 2 b]))) // Simplify


R Csc[2 (a - b)] (Cos[2 (a - b)] + Sin[a])

rules = Solve[Sin[a] == n*Sin[b], b]


{{b -> ConditionalExpression[ Pi - ArcSin[Sin[a]/n] + 2*Pi*C, Element[C, Integers]]}, {b -> ConditionalExpression[ ArcSin[Sin[a]/n] + 2*Pi*C, Element[C, Integers]]}}

expr2 = expr /. rules //
FullSimplify[#, Element[C, Integers]] &


{R Csc[2 (a + ArcCsc[n Csc[a]])] (Cos[2 (a + ArcCsc[n Csc[a]])] + Sin[a]), R Csc[2 (a + ArcSec[n Csc[a]])] (Cos[2 (a + ArcSec[n Csc[a]])] - Sin[a])}