6
$\begingroup$

Suppose we have many expressions involving irrational ArcTan expressions (such as ArcTan[Sqrt[3],5]) along with other irrational factors (such as 1/Sqrt[2]).

I want to simplify all of these ArcTans. For example, I might want to apply N to them to get their decimal approximation, or I might want to apply Rationalize as in

N@ArcTan[Sqrt[3], 5]
(* out: 1.23732 *)   

Rationalize[ArcTan[Sqrt[3], 5]/Pi, .0001] Pi  
(* out: 13 Pi/33 *)  

However, I would like to be able to implement either of these options throughout large expressions involving many ArcTan functions and not act on any other forms.

Simple example would be:

m = 1/Sqrt[3]+ Sqrt[2] ArcTan[Sqrt[3], 5]  

How can I apply a rule or something to m that will allow me to implement one of these types of solutions to the ArcTan but not act on the other irrational factors?

$\endgroup$
  • $\begingroup$ Something like m /. ArcTan[Times[x_, y_]] :> ArcTan[fff[x], ggg[y]] /; ! Element[x | y, Rationals] may work $\endgroup$ – Dr. belisarius Mar 12 '14 at 21:56
  • $\begingroup$ It may, but I haven't yet been able to construct fff and ggg correctly to implement it this way. $\endgroup$ – Steve Mar 13 '14 at 14:29
  • $\begingroup$ For example m = 1/Sqrt[3] + Sqrt[2] ArcTan[Sqrt[3], 5]; f[u_] := u /. ArcTan[Times[x_, y_]] :> (Rationalize[ArcTan[Times[x, y]]/Pi, .0001] Pi) /; ! Element[x | y, Rationals]; f[m] $\endgroup$ – Dr. belisarius Mar 13 '14 at 14:48
4
$\begingroup$

Approaching (stealing) of Dr. Belisarius's answer which was very helpful, I present my answer:

Providing an m equation:

m = 1/Sqrt[3]+ Sqrt[2] ArcTan[Sqrt[3], 5]

$\frac{1}{\sqrt{3}}+\sqrt{2} \tan ^{-1}\left(\frac{5}{\sqrt{3}}\right)$

You can implement this type of solution:

f[u_] := u /. 
  ArcTan[x_ y_] :> π Rationalize[ArcTan[x y]/π, 0.0001];
f[m]

$\frac{13 \pi \sqrt{2}}{33}+\frac{1}{\sqrt{3}}$

$\endgroup$

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.