# Solving a trigonometric equation for all $x$ using constant coefficients

I want to find the coefficients $a$, $b$, $c$, etc. that make an equation like $a+bx=x$ true for all $x$, but for trigonometric functions of $x$. For example

SolveAlways[a + b x == x, x]


returns

{{a -> 0, b -> 1}}


On the other hand,

SolveAlways[Sin[x] == Sin[a x], x]


returns

SolveAlways::ifun: Inverse functions are being used by SolveAlways, so some solutions may not be found; use Reduce for complete solution information. >>
{{Sin[x] -> Sin[a x]}, {}}


Any tips on how to solve this problem?

• Try using Reduce instead of SolveAlways. – Saurav Dec 10 '15 at 21:36
• I tried Reduce[ForAll[x, Sin[a x] == Sin[x]], a] but it says the system cannot be solved with the methods available to Reduce. – user76284 Dec 10 '15 at 21:42
• Reduce[Sin[x] == Sin[a x], x] should give you the results and conditions for the results to hold true. – Saurav Dec 10 '15 at 21:43
• Thanks. That gives a very complex expression though: C[1] \[Element] Integers && ((1 + a != 0 && (x == (2 (-(\[Pi]/2) + 2 \[Pi] C[1]))/(1 + a) || x == (2 (\[Pi]/2 + 2 \[Pi] C[1]))/(1 + a))) || (-1 + a != 0 && (x == -((4 \[Pi] C[1])/(-1 + a)) || x == -((2 (\[Pi] + 2 \[Pi] C[1]))/(-1 + a)))) || a == 1) Is there a good way to simplify it to a == 1? – user76284 Dec 10 '15 at 21:46
• Yes, it's complex but complete and beautiful in mathematical sense, in my opinion. – Saurav Dec 10 '15 at 21:49

Reduce[Sin[x] == Sin[a x], x] should give you the results and conditions for the results to hold true.
The result may seem complex, however it is complete and correct. If you take some time to look into the result, it may appear simple and understandable. Further, you can choose the parts of the solution depending on your value of $a$.
• How can I extract the a == 1 solution? – user76284 Dec 10 '15 at 21:53
• You can take part Reduce[Sin[x] == Sin[a x], x][[2,3]] (may not be the best way). However, if you know $a=1$ then why not substitute outright in the equation! – Saurav Dec 10 '15 at 22:04
• It might be a more complicated expression so I might not know the value of $a$ ahead of time. Perhaps there is a programmatic way to extract the solution under the simplest assumptions? – user76284 Dec 10 '15 at 22:38
• Agreed. This is Mathematica, not Mathemagica. The expressions given by Reduce are as succinct as I think one could possible expect from a computer that is trying to be as complete as possible. – djphd Dec 11 '15 at 5:12