2
$\begingroup$

I expect this call:

Reduce[Sin[x] - Cos[x] == 0, x, Reals]

to return

$x = \pi/4 + 2k\pi \ \vee \ x = -3/4 \ \pi + 2k\pi$.

However, $\pi/4$ and $3/4\ \pi$ get represented as -2 ArcTan[1 - Sqrt[2]] and -2 ArcTan[1 + Sqrt[2]].

MMA seems to know they're the same:

Reduce[-2 ArcTan[1 - Sqrt[2]] == Pi/4]

returns True.

Note I have restricted the domain to $\mathbb{R}$. How can I force MMA to display the mathematical constants instead of the inverse tangent function?

$\endgroup$
2
  • 4
    $\begingroup$ Reduce[Sin[x] - Cos[x] == 0, x, Reals] // FullSimplify gives a slightly restructured form. Solve[Sin[x] - Cos[x] == 0, x, Reals] // FullSimplify is essentially the same. Reduce and Solve do not automatically simplify. $\endgroup$
    – Bob Hanlon
    Apr 26, 2022 at 19:12
  • $\begingroup$ Thank you, I haven't thought of FullSimplify but I did try other options such as ToRadicals, which didn't have the effect. Reduce[…]//FullSimplify//Solve[#, x] & // Expand gives me the desired result. $\endgroup$
    – vpprof
    Apr 26, 2022 at 20:58

1 Answer 1

4
$\begingroup$
Reduce[Sin[x] - Cos[x] == 0, x, Reals] /. 
 ArcTan[x__] :> FullSimplify@ArcTan[x]

$$c_1\in \mathbb{Z}\land \left(x=-\frac{3 \pi }{4}+2 \pi c_1\lor x=\frac{\pi }{4}+2 \pi c_1\right)$$

$\endgroup$
2
  • $\begingroup$ Superb! What is the significance of the double underscore, can it be replaced with a single underscore? Is it there to differentiate the x in the equation from the x in the replacement rule? $\endgroup$
    – vpprof
    Apr 26, 2022 at 22:12
  • $\begingroup$ A double underscore matches a sequence of one or more expressions. In this case, one can do without it. $\endgroup$
    – Syed
    Apr 27, 2022 at 3:16

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.