1
$\begingroup$

I have this differential equation, for a function $ h(x) $ subject to a initial condition $ h(0) = n $, and a relation $ h^2(x) = p(x) $

$$ (1 + x)^4 \frac{\mathrm{d} }{\mathrm{d} x} \left(\frac{h(x)^2}{(1 + x)^3}\right) = 2 h(x) $$

I solve it with Mathematica

DSolve[{(1 + x)^4 D[h[x]^2/(1 + x)^3, x] == 2 h[x], h[0] == n}, h, {x,0, 1150}]

And I get this solution

h -> Function[{x}, 1/3 (-2 + 2 (1 + x)^(3/2) + 3 n (1 + x)^(3/2))

If I use the relation for $ h(x) $, I get this differential equation

$$ (1 + x)^4 \frac{\mathrm{d}}{\mathrm{d} x} \left(\frac{p(x)}{(1 + x)^3}\right) = 2 \sqrt{p(x)} $$

Solving with Mathematica, with the initial condition $ p(0) = n^2 $

DSolve[{(1 + x)^4 D[p[x]/(1 + x)^3, x] == 2 p[x]^(1/2), p[0] == n^{2}}, p, {x, 0, 1150}]

I get a different solution (Mathematica gives four solutions)

p -> Function[{x}, 1/9 (8 + 12 n + 9 n^2 + 12 x + 36 n x + 27 n^2 x + 12 x^2 + 36 n x^2 + 27 n^2 x^2 + 4 x^3 + 12 n x^3 + 9 n^2 x^3 - 8 Sqrt[1 + x] - 12 n Sqrt[1 + x] - 8 x Sqrt[1 + x] -12 n x Sqrt[1 + x])

Why we get two different solutions?

$\endgroup$
5
  • 2
    $\begingroup$ They seem to be equivalent. h[x]^2 - p[x] /. {hsol, psol} yields 0. $\endgroup$
    – Michael E2
    Commented Apr 14, 2020 at 3:57
  • $\begingroup$ Thank you for your answer. You know why mathematica gives four different solutions? $\endgroup$
    – No name
    Commented Apr 14, 2020 at 4:01
  • $\begingroup$ since you are using DSolve, why do you gives {x,0, 1150} instead of just x? $\endgroup$
    – Nasser
    Commented Apr 14, 2020 at 4:12
  • $\begingroup$ Oh, I was making some tests with NDSolve and I forget to delete the interval {x,0,1150} $\endgroup$
    – No name
    Commented Apr 14, 2020 at 4:16
  • $\begingroup$ No, not off hand, other than it seems to get a solution implicitly as an equation, from which Solve [sic] returns four branches. Only one of them has only real coefficients. $\endgroup$
    – Michael E2
    Commented Apr 14, 2020 at 4:19

1 Answer 1

4
$\begingroup$

Solve for initial condition later and omit solution = zero.

dsol = DSolve[{(1 + x)^4 D[h[x]^2/(1 + x)^3, x] == 2 h[x]}, h, x]

(*   {{h -> Function[{x}, 0]}, 
      {h -> Function[{x}, -(2/3) + (1 + x)^(3/2) C[1]]}}   *)

sol = Solve[n == h[0] /. dsol[[2]], C[1]]

(*   {{C[1] -> 2/3 + n}}   *)

hh[x_] = h[x] /. dsol[[2]] /. sol[[1]]

(*   -(2/3) + (2/3 + n) (1 + x)^(3/2)   *)

p[x_] = hh[x]^2 // Simplify

(*   (-(2/3) + (2/3 + n) (1 + x)^(3/2))^2   *)

p[0]

(*   n^2   *)
$\endgroup$
1
  • $\begingroup$ Thank you for your recomendation $\endgroup$
    – No name
    Commented Apr 14, 2020 at 5:15

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.