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$
5
  • 3
    $\begingroup$ Reduce[{al == Sin[b] Cos[a], am == Sin[b] Sin[a], an == Cos[b]}, {a, b}]? $\endgroup$ Commented 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
    Commented May 3, 2022 at 23:07
  • $\begingroup$ @JimB I'm referring to this example $\endgroup$
    – Gavin Nop
    Commented 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
    Commented May 3, 2022 at 23:22
  • $\begingroup$ The 3rd example doesn't work in v12.3 and v14.0, which version did you use? $\endgroup$
    – xzczd
    Commented Mar 12 at 7:51

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 you have read our privacy policy.

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