After solving a differential equation I obtain a pure function which I wish to simplify.
I am able to simplify the corresponding expression
expr = Cos[x] Cot[g] / Sqrt[-Cos[a]^2 Cot[g]^2 + Sin[a]^2]
according to the relationship k == Sin[a] / Cos[g]
using a replacement followed by simplification with assumptions:
expr /. a -> ArcSin[k Cos[g]] // FullSimplify[#, 0 < g < Pi/2] &
(* Cos[x] / Sqrt[-1 + k^2] *) (* hooray *)
However if I attempt the same thing with the pure function (which is the output of some DSolve
command)
fun = Function[{x}, Cos[x] Cot[g] / Sqrt[-Cos[a]^2 Cot[g]^2 + Sin[a]^2]]
it doesn't work:
fun /. a -> ArcSin[k Cos[g]] // FullSimplify[#, 0 < g < Pi/2] &
(* Function[{x}, Cos[x] Cot[g] / Sqrt[-Cos[ArcSin[k Cos[g]]]^2 Cot[g]^2 + Sin[ArcSin[k Cos[g]]]^2]] *)
How do I get the body of the pure function to simplify in the same way as it does with the expression? (i.e. desired output is Function[{x}, Cos[x] / Sqrt[-1 + k^2]]
)