# Stuck on solving differential equation

I have tried to solve :

$$\begin{array}{l} A\frac{1}{r}\frac{d}{{dr}}\left( {r\frac{{du}}{{dr}}} \right) = - B + N{k^2}\frac{{{I_0}\left( {kr} \right)}}{{{I_0}\left( {ka} \right)}}\\ BC:\\ u(r) = a\\ \frac{{du}}{{dr}} = 0\,\,\,at\,\,\,\,r = 0 \end{array}$$

with

DSolve[A (1/r) D[r  D[u[r], r], r] == -B +  N  k^2  (BesselI[0, k r]/ BesselI[0, a r]), u'[0] == 0, u[a] == 0, u[r], r]


but I didn't have any solution

Fix your typo's to match your latex and we get a solution no problem.

ode = (A*D[r*D[u[r], r], r])/r == -B + (n*k^2*BesselI[0, k*r])/BesselI[0, k*a]

bc1 = u'[0] == 0
bc2 = u[a] == 0

DSolve[{ode, bc1, bc2}, u[r], r] // Flatten

{u[r] -> (
a^2 B BesselI[0, a k] - 4 n BesselI[0, Sqrt[a^2 k^2]] -
B r^2 BesselI[0, a k] + 4 n BesselI[0, Sqrt[k^2 r^2]])/(
4 A BesselI[0, a k])

• first I thank you so much, second could you tell me where is my typo's? with many thanks – user3234456 Feb 4 '19 at 4:24
• You have BesselI[0,a r] instead of BesselI[0,k a] in your code. – Bill Watts Feb 4 '19 at 4:38

Chances are better with correct syntax. You missed a pair of braces ({ }) around the equations. Moreover, N is a built-in symbol, so I replaced it with n. This is how the corrected code looks like:

DSolve[{
A (1/r) D[r D[u[r], r], r] == -B + n k^2 (BesselI[0, k r]/BesselI[0, a r]),
u'[0] == 0,
u[a] == 0
},
u[r],
r
]


However, it takes forwever to evaluate. This tells me that it is quite likely that no closed-form solution can be derived (under the given information). If you are interested only in a solution for concrete values of B, k, n, and a, you should first assign these values and use the numerical solver NDSolve instead. Parameter studies can be performed with ParametricNDSolve.

• thanks for reply, unfortunately I need analytical solution only – user3234456 Feb 3 '19 at 19:44
• BesselI[0, a r] should be BesselI[0, k a]`. – bbgodfrey Feb 3 '19 at 22:25