de-CH
utf-8
math math-format
Inhomogeneous Solution
dgl-03-02a
multiple
2000
randRange(-10,-1) randRangeExclude(1,10,[-A]) randRangeNonZero(-10,10) randRangeExclude(-5,5,[-2,-1,0,1,2]) A+B

Consider the ODE y'(x) = -\dfrac{y(x)}{x - A} + \dfrac{Ex}{x - A} with y(0) = D and x > A.

Determine the value \color{orange} y(C) of the solution function of the IVP.

x \color{orange} y(C) = (0.5*E * C*C - A*D)/(C-A)

First, we determine the general solution of the associated homogeneous ODE y'(x) = p(x) \cdot y(x).

It is given by y(x) = K \cdot e^{P(x)}.

Here, K is a constant and \displaystyle P(x) \in \int p(x) dx is an antiderivative of p.

We have \displaystyle P(x) \in \int p(x) dx = \int -\dfrac{1}{x - A} dx = -\ln |x - A| = -\ln(x - A) + constant, since x > A.

Substituting gives y(x) = K \cdot e^{P(x)} = K \cdot e^{-\ln(x - A)} = K \cdot \dfrac{1}{x - A}.

The integration constant K is determined in the end by the initial condition y(0) = D, along with other constants.

Using the method of variation of constants, the general solution of the inhomogeneous ODE is \displaystyle y(x) = \left( \int e^{-P(x)} \cdot q(x) dx + C \right) e^{P(x)}.

We calculate e^{-P(x)} \cdot q(x) = e^{-(-\ln(x - A))} \cdot \dfrac{Ex}{x - A} = (x - A) \cdot \dfrac{Ex}{x - A} = Ex

and \displaystyle \int e^{-P(x)} \cdot q(x) dx = \int Ex dx = fractionReduce(E,2) x^2 + C.

The general solution of the inhomogeneous ODE is therefore \displaystyle y(x) = \left(fractionReduce(E,2) x^2 + C \right) e^{P(x)} = \left(fractionReduce(E,2) x^2 + C \right) \frac{1}{x - A} = \frac{fractionReduce(E,2) x^2 + C}{x - A}.

With y(0) = D = \dfrac{0 + C}{0 - A}, we find that C = -A*D.

Thus, the solution of the IVP is \displaystyle y(x) = \frac{fractionReduce(E,2) x^2 + -A*D}{x - A}.

Substitution gives {\color{orange} y(C)} = fractionReduce(0.5*E * C*C - A*D, C-A) .