I solved the following inhomogeneous second order differential equation:
SolGeneralNonHomo =
DSolve[1/2*\[Sigma]X^2*V1''[x] + ((a0*\[Delta])/a1 - a1*x)*V1'[x] -
em*V1[x] + (2*x - 2*ep*(a0 + a1*x)* \[Lambda])/(em - ep) == 0,
V1[x], x] // FullSimplify
I want to plot one possible solution. So first I specify numerical values for the parameters:
\[Delta] = 0.99;
\[Theta] = 1.5;
\[Epsilon] = 1.5;
\[CurlyPhi] = 5.0;
\[Xi] = 0.02;
\[Lambda] = 0.5;
\[Sigma]X = 0.20;
\[Mu]A = 0.15;
\[Sigma]A = 0.20;
rn = \[Delta] + \[Mu]A - \[Sigma]A^2;
em = (\[Delta]*\[Theta] -
Sqrt[\[Delta]^2*\[Theta]^2 +
4*\[Theta]*(\[Epsilon] - 1)*(1 + \[CurlyPhi])])/(2*\[Theta]);
ep = (\[Delta]*\[Theta] +
Sqrt[\[Delta]^2*\[Theta]^2 +
4*\[Theta]*(\[Epsilon] - 1)*(1 + \[CurlyPhi])])/(2*\[Theta]);
a1 = (-\[Delta]*\[Theta] +
Sqrt[\[Delta]^2*\[Theta]^2 +
4*\[Theta]*(\[Epsilon] - 1)*(1 + \[CurlyPhi])])/(2*\[Theta]);
a0 = -((\[Xi] + rn -
1/2*\[Sigma]X^2 - \[Sigma]A*\[Sigma]X)/(\[Delta] + a1))*a1;
Then I assign the solution with these values to a new variable:
p[x_] = V1[x] /. SolGeneralNonHomo[[1]]
This yields:
9.9501 (0.528212 + 1.00669 x) C[1] +
C[2] Hypergeometric1F1[-0.5, 1/2,
24.7511 (0.528212 + 1.00669 x)^2] +
9.9501 (0.528212 + 1.00669 x) Inactive[Integrate][-((
0.669635 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] (-0.531771 -
1.11022*10^-16 K[1]))/(
0.201003 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] +
9.9501 Hypergeometric1F1[0.5, 3/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] (0.528212 +
1.00669 K[1]) (0.528212 + 1.00669 K[1.]))), {K[1], 1, x}] +
Hypergeometric1F1[-0.5, 1/2,
24.7511 (0.528212 + 1.00669 x)^2] Inactive[Integrate][(
6.66293 (-0.531771 - 1.11022*10^-16 K[2]) (0.528212 +
1.00669 K[2.]))/(
0.201003 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[2])^2] +
9.9501 Hypergeometric1F1[0.5, 3/2,
24.7511 (-0.528212 - 1.00669 K[2])^2] (0.528212 +
1.00669 K[2]) (0.528212 + 1.00669 K[2.])), {K[2], 1, x}]
Is there a reason why Mathematica can't evaluate this expression? For example, the following:
p[0.2]
Outputs this rather than a number:
7.2591 C[1] - 22873.1 C[2] +
7.2591 Inactive[Integrate][-((
0.669635 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] (-0.531771 -
1.11022*10^-16 K[1]))/(
0.201003 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] +
9.9501 Hypergeometric1F1[0.5, 3/2,
24.7511 (-0.528212 - 1.00669 K[1])^2] (0.528212 +
1.00669 K[1]) (0.528212 + 1.00669 K[1.]))), {K[1], 1, 0.2}] -
22873.1 Inactive[Integrate][(
6.66293 (-0.531771 - 1.11022*10^-16 K[2]) (0.528212 +
1.00669 K[2.]))/(
0.201003 Hypergeometric1F1[-0.5, 1/2,
24.7511 (-0.528212 - 1.00669 K[2])^2] +
9.9501 Hypergeometric1F1[0.5, 3/2,
24.7511 (-0.528212 - 1.00669 K[2])^2] (0.528212 +
1.00669 K[2]) (0.528212 + 1.00669 K[2.])), {K[2], 1, 0.2}]