Message Boards Message Boards

0
|
336 Views
|
9 Replies
|
7 Total Likes
View groups...
Share
Share this post:

FullSimplify again not realizing the simplest solution. (ICBM problem)

Hello experts,

In deriving the optimal launch angle for an ICBM on a nonrotating airless spherical planet (physics - at least it's not a cow!), I followed the typical steps that a student would and ended up with this function:

optlaunchangle[dtheta_]:=ArcTan[ (1 - Sin[dtheta/2]) / Cos[dtheta/2]]

for dtheta < Pi radian, where dtheta is the angular distance between launch and impact points subtended at the center of the planet.

If you plot this function for 0<= dtheta < Pi, you will see that this is identical to a simple linear

(Pi - dtheta) / 4 

over the domain. (Note that as dtheta->0 the optimal angle -> Pi/4 or 45 degrees, as expected for a short-range trajectory.)

If this is obvious to you, why is it not obvious to:

FullSimplify[ArcTan[(1 - Sin[dtheta/2])/Cos[dtheta/2]] , 
 0 < dtheta < Pi]  

? This is a straightforward example, but leaves me wondering what other simplifications FullSimplify[] is missing.

Thanks in advance for any comments!

POSTED BY: Philip Blanco
9 Replies

For simpler trig, I've usually used this FTC approach:

expr = ArcTan[(1 - Sin[dtheta/2])/Cos[dtheta/2]];
Assuming[0 < dtheta < Pi,
 (expr /. dtheta -> 0) + 
  Integrate[D[expr, dtheta], {dtheta, 0, dtheta}]
 ]
(*  -(dtheta/4) + \[Pi]/4  *)

Same idea, alternative code:

DSolveValue[{y'[dtheta] == D[expr, dtheta], 
  y[0] == expr /. dtheta -> 0}, y[dtheta], dtheta]
(*  1/4 (-dtheta + \[Pi])  *)
POSTED BY: Michael Rogers

If you're truly interested in why FullSimplify[] fails, I can offer some hints. I don't know for sure, in fact, but its occasional failures like this seem understandable to me, and I can share my understanding.

FullSimplify[] has an extensive set of transformations. But it's finite. I'm not sure what it is in it and what is not. Somewhat relevant here is that it has a general addition/subtraction identity for tangent for a general angle a but not for the specific angle Pi/4:

(1 - Tan[t])/(1 + Tan[t]) // FullSimplify
(*  -1 + 2/(1 + Tan[t])  *)

(Tan[a] - Tan[t])/(1 + Tan[a] Tan[t]) // FullSimplify
(*  Tan[a - t]  *)

FullSimplify[] is a minimizer. I don't think the above is the snag that stops it. FullSimplify[] will take a step if a transformation results in an expression that is less complex. If it is more complex, it may try a couple of more steps to see if it gets over a hump to a less complex expression. If it takes several complicated steps before one gets to the desired form, FullSimplify[] may stop before it gets there, even if the required transformations are in its toolbox. I think this is probably what happens.

FullSimplify has plug-in capabilities to enhance its performance. See the options TransformationFunctions and ComplexityFunction.

POSTED BY: Michael Rogers
Posted 3 days ago

Maybe it's not a straight forward example. Does ArcTan[(1 - Sin[dtheta/2])/Cos[dtheta/2]] simplify in Maple or some other program?

POSTED BY: Jim Baldwin

Examples

Some example for you. Sorry I don't have time to explain.

Series approach

(* match expression to c Tan[k t + ArcTan[a]] == c(a+Tan[k t])/(1-a Tan[k t]) via Series *)
tanSumReduce // ClearAll;
tanSumReduce[expr : _. _Tan] := expr; (* skip k*Tan[x] *)
tanSumReduce[expr_] := With[{arg = Cases[expr, Tan[x_] :> x, Infinity]},
   Module[{c, a, k, paramsol, t},
     paramsol = SolveAlways[
       Normal@Series[
          c (a + Tan[k t])/(1 - a Tan[k t]) - 
           (expr /. First@arg -> t), {t, 0, 3}] == 0, t];
     Replace[
      expr,
      {e_ /; Length@paramsol > 0 :> 
        With[{res = c Tan[k*First@arg + ArcTan@a] /. Last@paramsol},
         res /; Simplify[res - expr] === 0]}
      ]
     ] /; Length[arg] > 0];

Assuming[2 Pi < dtheta < 3 Pi,
 FullSimplify[ArcTan[(1 - Sin[dtheta/2])/Cos[dtheta/2]],
  TransformationFunctions -> {Automatic, tanSumReduce}]
 ]
(*  1/4 (-dtheta + \[Pi])  *)

Differential equations approach

One needs to specify the independent variable. It is not deduced automatically.

(* match c Tan[k t + t0] via D[y'[k t]/c/k==(y[k t]/c)^2+1, t] *)
tanReduce // ClearAll;
tanReduce[v_][expr_] := Module[{y, v0, amp, freq, sign},
   y[Pattern[Evaluate[v], _]] = expr;
   amp = Sqrt@Simplify[y[v] (2 y'[v]^2 - y''[v] y[v])/y''[v]];
   v0 = ArcTan[y[0]/amp];
   freq = 
    Sqrt@Simplify[y''[v] (2 y'[v]^2 - y''[v] y[v])/(4 y[v] y'[v]^2)];
   sign = Sign[Limit[y'[v], v -> (v0)/freq]];
   amp*Tan[sign*freq*v + v0] /; 
    Simplify[y[v] - amp*Tan[sign*freq*v + v0]] === 0
   ];

Simplify[ArcTan[(1 - Sin[dtheta/2])/Cos[dtheta/2]], 0 < dtheta < Pi, 
 TransformationFunctions -> {Automatic, tanReduce[dtheta]}]
(*  1/4 (-dtheta + \[Pi])  *)
POSTED BY: Michael Rogers

Well the simplified solution is straightorward! Thanks for replying. I don't have access to those other tools. I had a go with Symbolab and it could not simplify the original expression.

POSTED BY: Philip Blanco

Similar example, see here

Regards M.I.

POSTED BY: Mariusz Iwaniuk

Removed

POSTED BY: Gianluca Gorni

That's a nice example, thank you, and one of the things they did (and I did) was a series expansion, which gives the equivalent simple linear expression with higher order terms zero (at least as far as one wants to set the order!). They also evaluated the derivative and showed how simple it was - neat trick.

Next stop - let's see how grok3 AI does. (Edited). grok3 solved it after a number of tries and a few screenfuls of test functions, It found that

( 1-Sin[A] ) / Cos[A] is the same as Tan[Pi/4 -A/2] and used that.

POSTED BY: Philip Blanco

FTC = Fundamental Theorem of Calculus not Federal Trade Commission! (For interested readers.) Thank you Michael Rogers for your detailed explanation and suggestions. I shall play with FullSimplify[] options to understand them better. grok3 AI was able to simplify my expression to a linear function by trial-and-error, and scarily was able to make an educated guess at what problem I was solving! (Although I used my Google account to log in, so it may have accessed my web search history - also scary!)

POSTED BY: Philip Blanco
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract