# How to understand and use DSolve solution

This equation is simple to DSolve in Mathematica, but I don't know how to use and understand solution.

 DSolve[Y1''[x] - a2 Y1[x] - a1*X1[x] == 0, Y1[x], x]


$\text{Y1}[x]\to e^{\sqrt{\text{a2}} x} C[1]+e^{-\sqrt{\text{a2}} x} C[2]+e^{-\sqrt{\text{a2}} x} \left(e^{2 \sqrt{\text{a2}} x} \int_1^x \frac{\text{a1} e^{-\sqrt{\text{a2}} K[1]} \text{X1}[K[1]]}{2 \sqrt{\text{a2}}} \, dK[1]+\int_1^x -\frac{\text{a1} e^{\sqrt{\text{a2}} K[2]} \text{X1}[K[2]]}{2 \sqrt{\text{a2}}} \, dK[2]\right)$

What is dK1 and dK2, how to solve integrals [1,x], and how to use this solution Y1[x] to find X1[x] in another equation

Derivative[2][X1][x] == Y1[x]

-

the dK[2] just means the integral is with respect to K[2],

$\int f(t) dt$ is exactly the same as $\int f(K[2]) dK[2]$

In this case, it appears in the solution because X1[x] is an unknown, so the only way for the differential equation to be formally solved is to include how it would affect the solution via the integrals. However, you can solve for x1 at the same time:

sol = DSolve[{
y1''[x] - a2 y1[x] - a1 x1[x] == 0,
x1''[x] == y1[x]},
{y1[x], x1[x]}, x]


Since no initial conditions are supplied the result has a bunch of arbitrary constants called C[i] in this case there are four of them.

Here's an example using the result to create two functions f,g that correspond to y1,x1 with some specific constants:

Clear[f, g]
params = {a1 -> 1., a2 -> -2., C[1] -> 3., C[2] -> -3., C[3] -> 2., C[4] -> 3.};
f[x_] = y1[x] /. sol /. params;
g[x_] = x1[x] /. sol /. params;
Plot[{f[x], g[x]}, {x, 0, 1}]


-