8
$\begingroup$

Bug introduced in 4.1 or earlier and fixed in 12.3


To the problem below, I get four independent, incomplete solutions, three in terms of Solve`DirInf[]. Since DirInf is not in the System` context, I assume this behavior is a bug (or not?). But I was wondering if it made any sense as a solution.

Solve[Flatten@{
   NestList[
     D[#, x] &, (
      Hypergeometric2F1[1/2, 2/3, 5/3, (8 I y[x]^(3/2))/(3 C[1])]^2 y[
        x]^2 (1 - (8 I y[x]^(3/2))/(3 C[1])))/(
      C[1] - 8/3 I y[x]^(3/2)) == (x + C[2])^2, 1] /. {x -> 0},
   y[0] == 1, y'[0] == 0},
 {C[1], C[2]}, {y[0], y'[0]}]

Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

Solve::svars : Equations may not give solutions for all "solve" variables. >>

{{C[1] -> -((8 I)/3)}, {C[1] -> (8 I)/3},
 {C[1] -> -(8/(3 Sqrt[-1 + 2 Solve`DirInf[] - Solve`DirInf[]^2]))},
 {C[1] -> 8/(3 Sqrt[-1 + 2 Solve`DirInf[] - Solve`DirInf[]^2])},
 {C[2] -> 0}}

BTW, Reduce fails on the system.

FWIW, the problem arises from the following IVP:

y''[x]^2 == -4 y[x] && y[0] == 1 && y'[0] == 0
$\endgroup$
6
  • 9
    $\begingroup$ Bug. That's an internal symbol that should not appear in results. $\endgroup$ Dec 7, 2020 at 20:34
  • 5
    $\begingroup$ A very old bug. Exactly the same output appear in Mathematica 5.2.0 and 8.0.4. $\endgroup$
    – innaiz
    Dec 8, 2020 at 11:24
  • $\begingroup$ @innaiz Thank you for the info. $\endgroup$
    – Michael E2
    Dec 8, 2020 at 14:11
  • 4
    $\begingroup$ Almost the same output in v4.1: i.stack.imgur.com/RxWgq.png Another incorrect result (but with proper warning) in v3.0: i.stack.imgur.com/m3mPU.png So this seems to be a bug since v4. $\endgroup$
    – xzczd
    Dec 8, 2020 at 14:42
  • 2
    $\begingroup$ @xzczd Thanks! I like the "should be checked by hand" in V3. I haven't seen that lately. It's funny, too, for how do you check Indeterminate by hand? The warning should have come before we got to Indeterminate. $\endgroup$
    – Michael E2
    Dec 8, 2020 at 15:15

1 Answer 1

1
$\begingroup$

I don't think, it'a a bug. Two ways to get the result you want.

First omit the comand to eliminate {y[0], y'[0]} in Solve. Since you explicitly set them Equal 1 and 0 and later want to eliminate it, Solve gets confused.

eqs = Flatten@{NestList[
 D[#, x] &, (Hypergeometric2F1[1/2, 2/3, 
       5/3, (8 I y[x]^(3/2))/(3 C[1])]^2 y[
       x]^2 (1 - (8 I y[x]^(3/2))/(3 C[1])))/(C[1] - 
     8/3 I y[x]^(3/2)) == (x + C[2])^2, 1] /. {x -> 0}, y[0] == 1,
y'[0] == 0}

Solve[eqs, {C[1], C[2]}]

(*   {{C[1] -> (8 I)/(
3 InverseFunction[Hypergeometric2F1, 4, 4][1/2, 2/3, 5/3, 0]), 
C[2] -> 0}}   *)   

Second, set the y with Rule to wanted values to get the same result

Solve[Flatten@
  Evaluate@{NestList[
   D[#, x] &, (Hypergeometric2F1[1/2, 2/3, 
         5/3, (8 I y[x]^(3/2))/(3 C[1])]^2 y[
         x]^2 (1 - (8 I y[x]^(3/2))/(3 C[1])))/(C[1] - 
       8/3 I y[x]^(3/2)) == (x + C[2])^2, 1] /. 
  x -> 0 /. {y[0] -> 1, y'[0] -> 0}}, {C[1], C[2]}, {y[0], y'[0]}
]

Edit

I am using version "8.0 for Microsoft Windows (32-bit) (December 9, 2010)"

@MichaelE2, you are right. Solve should be able to give solution for (but does not)

Solve[{c1 == y1, c2 == y2, y1 == 1, y2 == 0}, {c1, c2}]

Don't know why my first example works this time without command to eliminate the y.

Second, if you accept infinity as solution, C[1] -> +/- infinity together with C[2]==0 are solutions.

eqs2 = eqs /. {y[0] -> 1, y'[0] -> 0}

Plot[Evaluate@Through[{Re, Im}[eqs2[[1, 1]] /. C[1] -> c1]], {c1, -5, 
   5}, PlotStyle -> {Blue, Red}]

Limit[eqs2[[1, 1]], C[1] -> -\[Infinity]]

(*   0   *)

eqs /. {C[1] -> -\[Infinity], C[2] -> 0}

(*   {True, True, y[0] == 1, Derivative[1][y][0] == 0}   
*)
$\endgroup$
2
  • $\begingroup$ Tx! What version are you using? I get an empty set {} for the first. That might be right and InverseFunction[Hypergeometric2F1, 4, 4][1/2, 2/3, 5/3, 0] be undefined. Some limiting value for C[1], such as Infinity, might be a solution, but I haven't found one. For your second, I get that Solve cannot solve the equation. (V12.1.1, Mac) -- BTW the form in the OP was desired because Solve balks at simple things like Solve[Flatten@Evaluate@{NestList[D[#, x] &, y[x] == C[1] Sin[x] + C[2] Cos[x],1] /. {x -> 0}, y[0] == 1, y'[0] == 0}, {C[1], C[2]}], for me. Might be different for you. $\endgroup$
    – Michael E2
    Dec 9, 2020 at 14:13
  • $\begingroup$ @MichaelE2, i am using version "8.0 for Microsoft Windows (32-bit) (December 9, 2010)". See my Edit above. $\endgroup$
    – Akku14
    Dec 9, 2020 at 18:15

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.