I want to solve the following ODE in steps, as opposed to using Mathematica's solver directly:
\begin{align} \frac{1}{2} \sigma \frac{\partial^2 V (x_t)}{\partial x_t^2} + \left( \frac{\delta a_0}{a_1} - a_1 x_t \right) \frac{\partial V (x_t)}{\partial x_t} - e_+ V (x_t) &= -\frac{- 2x_t + 2 \lambda e_- (a_0 + a_1 x_t)}{e_- - e_+} \end{align}
ode = 1/2*sigma*V''[x] + ((delta*a0)/a1 - a1*x)*V'[x] - ep*V[x] == -((-2*x + 2*em*(a0 + a1*x)* lambda)/(em - ep));
First, I find the general solution of the homogeneous equation:
SolGeneralHomo = DSolveValue[ode[[1]] == 0, V[x], x] // FullSimplify
\begin{align} V^g(x_t) = c^1 H_{-\frac{e_+}{a_1}}\left(\frac{a_1^2 x_t-a_0 \delta }{a_1^{3/2} \sqrt{\sigma} }\right) + c^2 \, _1F_1\left(\frac{e_+}{2 a_1};\frac{1}{2};\frac{\left(a_1^2 x_t -a_0 \delta \right)^2}{a_1^3 \sigma}\right) \end{align}
Then I find a particular solution of the inhomogeneous equation. Let's postulate that: \begin{align} V (x_t) = h_0 + h_1 x_t \end{align} Substituting the ansatz into the differential equation: \begin{align} \frac{1}{2} \sigma \frac{\partial^2}{\partial x_t^2} \left( h_0 + h_1 x_t \right) + \left( \frac{\delta a_0}{a_1} - a_1 x_t \right) \frac{\partial}{\partial x_t} \left( h_0 + h_1 x_t \right) - e_+ \left( h_0 + h_1 x_t \right) &= -\frac{- 2x_t + 2 \lambda e_+ (a_0 + a_1 x_t)}{e_- - e_+} \nonumber \\ \left( \frac{\delta a_0}{a_1} - a_1 x_t \right) h_1 - e_+ \left( h_0 + h_1 x_t \right) &= -\frac{- 2x_t + 2 \lambda e_+ (a_0 + a_1 x_t)}{e_- - e_+} \end{align}
h1 = (-2 + 2*lambda*ep*a1)/((em - ep)*(a1 + ep));
h0 = (delta*a0)/(a1*ep)*h1 + (2*lambda*a0)/(em - ep);
SolParticularNonHomo = h0 + h1*x
Can you help me understand why Mathematica says that the differential equation is not satisfied?
FinalSol = SolGeneralHomo + SolParticularNonHomo // FullSimplify;
Sol = V -> Function[{x}, Evaluate[FinalSol]];
ode /. Sol // FullSimplify
The output is:
(a0 + a1 x) [Lambda] == 0
where even substituting for a0
and a1
the equality is not satisfied.