# What's a good way to do specific algebraic operations on an expression?

This is the first time I've submitted a question so please forgive my inexperience.

I want to simplify the following expression Cos[ArcTan[Xt/Rt]] which is equivalent to 1/Sqrt[1 + Xt^2/Rt^2]

The steps I want to use are:

1. Square the expression to get rid of the radical.
2. Multiply the numerator and denominator by the quantity Rt^2.
3. Simplify the denominator.
4. Produce the final result by taking the square root.

My code is:

cat = Cos[ArcTan[Xt/Rt]]
$Assumptions = {Rt \[Element] Reals, Rt > 0} num = Numerator[cat] Rt^2 den = (Denominator[cat]^2) Rt^2 // Simplify catnew = Sqrt[num/den] // Simplify catnew === cat  I have three specific questions: 1. Is there a better way to do this? (I'm sure there is!) 2. How do I check to see if the original expression (cat) and the new one (catnew) are algebraically equivalent? 3. How can I submit a question that includes the exact symbolic output from Mathematica? Thanks • With version 13.2.1, Cos[ArcTan[Xt/Rt]] automatically simplifies to the target form. What version are you using? Commented Jun 17, 2023 at 23:05 • @BobHanlon I think the OP meant by "is equivalent to" that it "evaluates to". The phrasing is ambiguous though. -- OP, did you mean Numerator[cat]^2 or are leaving it off since you know the numerator? I use your basic approach frequently. On the specific example, Simplify[Cos[ArcTan[Xt/Rt]], {Xt, Rt} \[Element] Reals] is another way. Also Simplify@Sqrt@Together[Cos[ArcTan[Xt/Rt]]^2]. Not sure if you care where the square root is. Commented Jun 17, 2023 at 23:26 ## 1 Answer Q1. Whenever working in an irrational field like inverse trigonometics or elliptic functions, try to rationalize in the power field. Here  cat^2 /. {a_/b_ :> Sqrt[ a^2/b^2]} // Together // Sqrt//PowerExpand  $$\frac{\text{Rt}}{\sqrt{\text{Rt}^2+\text{Xt}^2}}$$ The results may by wrong with respect to signs or by steps in the complex argument by multiples in $$\pi$$, but yield a standard algebraic form for small positive variables as a guideline to find a simple target form. What brings us to Q2: Fast but not quite True in the complex domain:  Series[Cos[ArcTan[Xt/Rt]] == Rt/Sqrt[Rt^2 + Xt^2], {Rt, 0, 18}] //PowerExpand True  There has much work to be done, to get the true algebraic expressions in the other quadrants  ComplexPlot3D[ Cos[ArcTan[(2 + 7 I)/Rt]] - Rt/Sqrt[ Rt^2 + (2 + 7 I)^2], {Rt, -6.0 (1 + I), 6.0 (1 + I)}, AxesLabel -> {"Re", "Im"},BaseStyle -> {FontSize -> 7}]  Q3: Mathematica Input and Output: Copy Cell as Plain text or Input Text by a right click. Simply indent the paste here by more than 4 characters. Use Shift+Return to break indented lines. For nice TeX input, right click cell and copy as LaTeX, paste here in a separate line between \$\$\$\\$

• Thanks for your help. I'm just curious about the rule. I see that it replaces a fraction with the square root of the fraction squared. $$\text{PowerExpand}\left[\text{Together}\left[\sqrt{\text{cat}^2}\right]\right]$$ $$\frac{\text{Rt}}{\sqrt{\text{Rt}^2+\text{Xt}^2}}$$ The command above appears to do the same thing. Commented Jun 19, 2023 at 2:49