# 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+e^{-\sqrt{\text{a2}} x} C+e^{-\sqrt{\text{a2}} x} \left(e^{2 \sqrt{\text{a2}} x} \int_1^x \frac{\text{a1} e^{-\sqrt{\text{a2}} K} \text{X1}[K]}{2 \sqrt{\text{a2}}} \, dK+\int_1^x -\frac{\text{a1} e^{\sqrt{\text{a2}} K} \text{X1}[K]}{2 \sqrt{\text{a2}}} \, dK\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[X1][x] == Y1[x]


the dK just means the integral is with respect to K,

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

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 -> 3., C -> -3., C -> 2., C -> 3.};
f[x_] = y1[x] /. sol /. params;
g[x_] = x1[x] /. sol /. params;
Plot[{f[x], g[x]}, {x, 0, 1}] 