0
$\begingroup$

I can't seem to get FullSimplify to fully simplify this complicated expression. I've added relevant Assumptions that helped, but I still get this weird unnecessary reciprocal within a reciprocal that I'd expect Mathematica to catch easily. So, two questions:

How can I fix the specific problem with the reciprocal within a reciprocal?

Are there better coding techniques I could have used to, in general, get better results for this problem? I'm a bit rusty at Mathematica.

x = S/(Sin[q - theta/2]/Tan[phi] + Cos[q - theta/2]);
frac = x/(x /. phi -> theta);
phif = phi /. Solve[f == frac, phi][[1]];
phif = phif /. C[1] -> 0;
del = phif - (phif /. q -> Pi/2);
expr = D[del, f];
f0 = f /. Solve[expr == 0, f][[1]];

FullSimplify[f0, Assumptions -> {Sin[q + theta/2] > 0, Sin[q - theta/2] > 0}]
(* 1/2 Csc[2 q] Csc[theta/2] Sin[q] (-(1/Sqrt[(1/(-2 Cos[2 q] + 
   2 Cos[theta]))]) + 2 Sin[q + theta/2]) *)
$\endgroup$
4
  • $\begingroup$ Also, sorry, I can't seem to get the code formatting to work here. Neither triple ticks before & after nor crtl-K are working. $\endgroup$ Commented Dec 31, 2023 at 17:28
  • $\begingroup$ Apparently the formatting problem was because you started the previous two lines with "1:" and "2:" and that must have thought you were introducing some kind of list. Never seen that before. Removing those 4 characters and your formatting works fine. Strange. Now we can get to your real question $\endgroup$
    – Bill
    Commented Dec 31, 2023 at 17:30
  • $\begingroup$ @Bill Ah, thank you! $\endgroup$ Commented Dec 31, 2023 at 17:31
  • $\begingroup$ And FullSimplify[f0, Assumptions->{Sin[q+theta/2]>0, Sin[q-theta/2]>0,-2Cos[2q]+2 Cos[theta]>0}] gets rid of your "stacked" rationals. Is that EXACTLY what you wanted? I am hoping that added assumption is actually true ;} $\endgroup$
    – Bill
    Commented Dec 31, 2023 at 17:33

1 Answer 1

1
$\begingroup$

In response to Bill's helpful comments above, I started from scratch and just put in ALL of my assumptions, including those that were logically unnecessary or tighter than was logically necessary. This worked, and I learned an important lesson today.

f0 = FullSimplify[f0, Assumptions -> {q > theta, q < Pi - theta, theta > 0, theta < Pi/10}]
$\endgroup$

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.