1
$\begingroup$

I'm trying to solve for a certain set of trig identities in terms of other trig identities. I saw this and this, but in my example, I have two tries:

Solve[{al == Sin[b] Cos[a], 
  am == Sin[b] Sin[a], an == Cos[b]}, 
 Cos[b], {a, b}]
Solve[{am == Sin[b] Sin[a], an == Cos[b]}, 
 Cos[b], {a, b}]

In the first example, I get a null solution. In the second, Mathematica recognizes that the expression is just 'an'. Apparently I need to building the rule set up from scratch for solve to use, any suggestions here? The actual expressions I plan to use will be more complex, so it failing here isn't giving me much confidence... In the meantime, I'll be trying to generalize the Weierstrass approach.

Edit:

A fuller example might be:

Solve[{al == Sin[b] Cos[a], 
  am == Sin[b] Sin[a], an == Cos[b]}, 
 Sin[b] Cos[a] + Cos[b]^2, {a, b}]

Giving the result

al+an^2
$\endgroup$
4
  • 3
    $\begingroup$ Reduce[{al == Sin[b] Cos[a], am == Sin[b] Sin[a], an == Cos[b]}, {a, b}]? $\endgroup$ May 3, 2022 at 22:54
  • $\begingroup$ I'm not understanding the 2nd argument in all of your examples for Solve. Why do you include Cos[b] and Sin[b] Cos[a] + Cos[b]^2 as the 2nd argument? $\endgroup$
    – JimB
    May 3, 2022 at 23:07
  • $\begingroup$ @JimB I'm referring to this example $\endgroup$
    – Gavin Nop
    May 3, 2022 at 23:10
  • $\begingroup$ Thanks. I see (now) what is done in that example. (I'm still looking for that format in the Solve documentation but don't see it. But that's my problem, not yours.) $\endgroup$
    – JimB
    May 3, 2022 at 23:22

1 Answer 1

0
$\begingroup$

Generally you can not solve for a function of a variable (b in the first example) and at the same time try to eliminate that variable. Eliminate the other variables or functions of that.

Solutions to the first example

Solve[{al == Sin[b] Cos[a], am == Sin[b] Sin[a], an == Cos[b]}, 
 Cos[b], {Sin[a], Sin[b], Cos[a]}]

Don't know why second example works, it should not.

Third example: give the expression you are looking for a name and solve for that, eliminating other functions.

Solve[{al == Sin[b] Cos[a], am == Sin[b] Sin[a], an == Cos[b], 
  fin == Sin[b] Cos[a] + Cos[b]^2}, fin, {Sin[a], Cos[a], Sin[b], 
  Cos[b]}]

(*  {{fin -> al + an^2}}    *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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