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]


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

On the other hand,

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


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?

  • $\begingroup$ Try using Reduce instead of SolveAlways. $\endgroup$ – Saurav Dec 10 '15 at 21:36
  • $\begingroup$ 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. $\endgroup$ – user76284 Dec 10 '15 at 21:42
  • $\begingroup$ Reduce[Sin[x] == Sin[a x], x] should give you the results and conditions for the results to hold true. $\endgroup$ – Saurav Dec 10 '15 at 21:43
  • $\begingroup$ 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? $\endgroup$ – user76284 Dec 10 '15 at 21:46
  • $\begingroup$ Yes, it's complex but complete and beautiful in mathematical sense, in my opinion. $\endgroup$ – 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$.

  • $\begingroup$ How can I extract the a == 1 solution? $\endgroup$ – user76284 Dec 10 '15 at 21:53
  • $\begingroup$ 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! $\endgroup$ – Saurav Dec 10 '15 at 22:04
  • $\begingroup$ 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? $\endgroup$ – user76284 Dec 10 '15 at 22:38
  • $\begingroup$ I think you will have to analyse manually! Then substitute the conditions to form simpler expressions. $\endgroup$ – Saurav Dec 10 '15 at 22:44
  • $\begingroup$ 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. $\endgroup$ – djphd Dec 11 '15 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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