# Reduce yields ArcTan instead of Pi/4

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?

• 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. Apr 26, 2022 at 19:12
• 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. Apr 26, 2022 at 20:58

## 1 Answer

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)$$

• 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? Apr 26, 2022 at 22:12
• A double underscore matches a sequence of one or more expressions. In this case, one can do without it.
– Syed
Apr 27, 2022 at 3:16