How Can I Solve a Differential Equation with Non-Constant Coefficients?

  • Context: Undergrad 
  • Thread starter Thread starter dRic2
  • Start date Start date
  • Tags Tags
    Coefficient
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
19 replies · 3K views
dRic2
I was attempting to solve a differential equation using separation of variables' method. After some calculations I got to this:

$$ \frac 1 {a(r)} \frac k r \frac d {dr} \left(r \frac {da(r)}{dr} \right) = f $$

and I rearranged to this:

$$\frac k r \frac {da(r)}{dr} + \frac{d^2a(r)}{dr^2} = fa(r)$$

##k## and ##f## are constants. In a more elegant way:

$$ \ddot a + \frac k r \dot a - fa = 0 $$

Then I realized I don't know how to solve it because of ## \frac 1/r ##. I never studied how to solve differential equation with non-constant coefficients. Can anybody help me? Or suggest me some reading that can help me?
Thank you
 
on Phys.org
Thank you. I'll be studying it in the next days... see if I can get it done.
 
dRic2 said:
I was attempting to solve a differential equation using separation of variables' method. After some calculations I got to this:

$$ \frac 1 {a(r)} \frac k r \frac d {dr} \left(r \frac {da(r)}{dr} \right) = f $$

and I rearranged to this:

$$\frac k r \frac {da(r)}{dr} + \frac{d^2a(r)}{dr^2} = fa(r)$$

##k## and ##f## are constants. In a more elegant way:

$$ \ddot a + \frac k r \dot a - fa = 0 $$

Then I realized I don't know how to solve it because of ## \frac 1/r ##. I never studied how to solve differential equation with non-constant coefficients. Can anybody help me? Or suggest me some reading that can help me?
Thank you
This looks a lot like a Bessel equation. Are you familiar with Bessel functions?
 
Chestermiller said:
This looks a lot like a Bessel equation. Are you familiar with Bessel functions?
Not only looks like. It is Bessel's differential equation for ##k = 0## (or modified Bessel's differential equation depending on the signs of ##f## and ##k##), which is the reason I linked to the Wikipedia page on Bessel functions.
 
Hi, thanks for the replies.

I'm not familiar with Bessel's equation at all (I just happened to see it somewhere some times ago, so I knew there was a solution but I didn't even remember what to search). I checked the wikipedia page and I found out it's used to solve heat/mass transfer problems and it's funny because it is what I'm actually trying to do. So i think I'm on the right spot! :)

Anyway I think it is a bit too advanced to me right know, but I looked it up on "Mathematical methods for physics and engineering" and I found, like wikipedia says, Bessel's equation is:
$$ x^2 \ddot y + x \dot y + (x^2-k^2)y = 0 $$

My function looks instead like:

$$ kr^2 \ddot a + kr \dot a + fr^2a = 0 → r^2 \ddot a + r \dot a + \frac f k r^2a = 0$$

Since I started studying it this morning (with no special background in differential equations) I'd like to know if ##\frac f k ## affects the solutions of the equation and how. Thank you

Ps: since I got here by separating variables ##ƒ## is a constant which I no nothing about, I have to use B.C. later on to find it
 
Last edited by a moderator:
sorry I don't get it. I still have something different from bessel equation
 
Sorry, here:

(In order to make it easier I will put ##h = f/k##)

$$ \ddot a(r) + \frac 1 r \dot a(r) + ha(r) = 0$$
$$ r = x \sqrt \frac 1 h $$
Chain's rule:
$$ \frac {da(r)} {dr} = \frac d {dx} a \left(x \sqrt {\frac 1 h} \right) \frac {dx} {dx \sqrt {\frac 1 h}} = \sqrt h \frac d {dx} a \left(x \sqrt \frac 1 h \right) $$
$$ \frac {d^2a(r)} {dr^2} = \frac {d^2} {dx^2} a \left(x \sqrt {\frac 1 h} \right) \left( \frac {dx} {dx \sqrt {\frac 1 h}} \right)^2 + \frac d {dx} a \left(x \sqrt \frac 1 h \right) \frac {d^2x} {d \left( x \sqrt \frac 1 h \right)^2 } = h \frac {d^2} {dx^2} a \left( x sqrt \frac 1 h \right)$$
finally:
$$h \frac {d^2} {dx^2} a \left(x \sqrt \frac 1 h\right) + \frac 1 {x \frac 1 h} \sqrt h \frac d {dx} a \left(x \sqrt \frac 1 h \right) + h a \left(x \sqrt \frac 1 h \right) = 0$$
$$ \frac {d^2} {dx^2} a \left(x \sqrt \frac 1 h\right) + \frac 1 x \frac d {dx} a \left(x \sqrt \frac 1 h \right) + a \left(x \sqrt \frac 1 h \right) = 0 $$

How should I proceed ?
 
But there is ##\sqrt \frac 1 h ## inside the parenthesis... isn't it a problem?

I mean the solution of Bessel's equation is ##a(x) = c_1J_v(x)+c_2J_{-v}(x) ##, should I replace ##x## with ##x\sqrt \frac 1 h##?
 
Last edited by a moderator:
Oh thank you. Just to be sure, the solution is then ##a(r) = cJ_v(r\sqrt h)##?
 
Yes, thank you for mentioning @eys_physics. I'll be studying that too in the future. Btw I didn't understand if you are implying that my solution is wrong because I'm like in the middle of the ocean right now ahahah :frown:
 
No, your solutions is not wrong. I said that there are in general more solutions. The ones I mentioned, ##Y_v## are singular at the origin (r=0). So, if you want a regular solution they should be disregarded. But, it depends on the actual problem you want to solve, which wasn't clear from your post.

By the Frobenius method you can derive the solution of your equation in terms of series expansion. One can then compare with series expansions existing for the Bessel functions. It takes some effort but can be useful to understand better how to solve this kind of differential equations.
 
  • Like
Likes   Reactions: dRic2
eys_physics said:
The ones I mentioned, ##Y_v## are singular at the origin (r=0). So, if you want a regular solution they should be disregarded.
This is a common but not completely kosher argument. The question becomes why you want your solution to be regular at r=0. In the end it boils down to the behaviour of the inhomogeneity in your differential equation (typically r=0 is actually just a coordinate singularity in your domain). For example, the Green’s function of the Helmholtz equation in two dimensions involves a Bessel function of the second kind in order to take care of the delta inhomogeneity at r=0. However, as long as your inhomogeneity is sufficiently nice you will be able to assume regularity (and therefore throw away the Bessel functions of the second kind).

Of course, if r=0 is not part of your domain you cannot apply these arguments and you need to include both linearly independent solutions.
 
  • Like
Likes   Reactions: eys_physics
Thanks, Orodruin for your clarification. I was a bit sloppy with the wording in my post. The word "should" in the quoted sentence wasn't appropriate. I meant that in some cases the irregular solution could be disregarded (depending on the problem statement), but in other cases not as you mention.