3
$\begingroup$

For example: I solved the following differential equation:

y''[x] == (λ x^(3/4) y[x])/Sqrt[1-x]

that 0<x<1 with the following method:

sol = DSolve[z''[x] == λ*x^(3/4)* z[x]/Sqrt[x], z[x], x]
y[x_] = z[x] /. sol[[1]] /. x -> x - 1

and obtained this general solution:

(2/3)^(8/9) Sqrt[-1 + x] λ^(2/9)
   BesselI[-(4/9), 8/9 (-1 + x)^(9/8) Sqrt[λ]] C[1] Gamma[5/
   9] + (-1)^(4/9) (2/3)^(8/9) Sqrt[-1 + x] λ^(2/9)
   BesselI[4/9, 8/9 (-1 + x)^(9/8) Sqrt[λ]] C[2] Gamma[13/9]

How can I check that the general solution obeys the original differential equation ?

$\endgroup$
1
  • $\begingroup$ After doing sol = DSolve[z''[x] == λ*x^(3/4)* z[x]/Sqrt[x], z, x][[1]] (note the second argument!), try y''[x] == (λ x^(3/4) y[x])/Sqrt[1-x] /. y -> z[# - 1] & /. sol. $\endgroup$ Jun 19, 2015 at 10:54

2 Answers 2

4
$\begingroup$

You can check that a differential equation is solved correctly by plugging it in to the original equation and seeing that it holds. For your case:

sol = DSolve[z''[x] == λ*x^(3/4)*z[x]/Sqrt[x], z[x], x]
f[x_] := sol[[1, 1, 2]]

so f[x] is the candidate function. Now verify that:

FullSimplify[D[f[x], {x, 2}]] == FullSimplify[λ*x^(3/4)*f[x]/Sqrt[x]]

Since this returns True, you know you have the right answer.

$\endgroup$
4
  • $\begingroup$ I don't know that my method is true. $\endgroup$ Jun 19, 2015 at 11:15
  • $\begingroup$ This ODE says: there is a function whose 2cnd derivative is equal to the right hand side. Call it f[x]. The verification line takes the second derivative of this f[x] and shows that it is the same as the right-hand side. Hence it is an answer to the ODE. $\endgroup$
    – bill s
    Jun 19, 2015 at 11:19
  • $\begingroup$ What is sol[[1, 1, 2]] in your answerd? $\endgroup$ Jun 19, 2015 at 12:35
  • 1
    $\begingroup$ It's the 1,2,1 part of the variable sol, which is assigned as the calculated solution to the ODE. After running the code above, type f[x] to see it displayed. It is what you called the "general solution" in your question. $\endgroup$
    – bill s
    Jun 19, 2015 at 13:26
1
$\begingroup$

In this example, the solution is verified by substitution.

equation = y''[x]-x*y[x]-x == 0;
sol = DSolve[equation, y, x]
FullSimplify[equation /. sol]

{ True }

You can also check numerically. An example, we have a differential equation:

$$y''(x)-x y(x)-x=0$$

General solution is:

$$\left\{y(x)\to c_1 \text{Ai}(x)+c_2 \text{Bi}(x)-\pi \text{Ai}(x) \text{Bi}'(x)+\pi \text{Ai}'(x) \text{Bi}(x)\right\}$$

On the right side of the differential equation we have zero , so:

 sol = First@DSolve[y''[x] - x*y[x] - x == 0, y[x], x]
 Y = y[x] /. sol;
 DE = D[Y, {x, 2}] - x*Y - x;
 N@Table[DE /. {C[1] -> a, C[2] -> b, x -> c},
 {a, 1, 3}, {b, 1, 3}, {c, 1, 3}] // MatrixForm

enter image description here

Almost here are zeros.Check OK.

$\endgroup$
1
  • $\begingroup$ What you have is not Euler's beta function, but the incomplete beta function. $\endgroup$ Jun 26, 2015 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.