0
$\begingroup$

How can I code and solve the following differential equation in Mathematica:

$$\frac{\mathrm{d}}{\mathrm{d}x}\left(x^2 e^{2ax}\right) \frac{\mathrm{d}y}{\mathrm{d}x} + b x^2 y=0,$$

where $a$ and $b$ are constants?

$\endgroup$

1 Answer 1

1
$\begingroup$
Clear["Global`*"]

eqn = D[x^2*E^(2*a*x), x]*y'[x] + b*x^2*y[x] == 0

(* b x^2 y[x] + (2 E^(2 a x) x + 2 a E^(2 a x) x^2) y'[x] == 0 *)

Solving for y as a pure function (facilitates substitution into the original equation)

sol = DSolve[eqn, y, x][[1]]

(* {y -> Function[{x}, 
   E^((b (E^(-2 a x) + 2 E^2 ExpIntegralEi[-2 - 2 a x]))/(4 a^2)) C[1]]} *)

Verifying that the solution satisfies the equation,

eqn /. sol // Simplify

(* True *)

y[x] is then

y[x] /. sol

(* E^((b (E^(-2 a x) + 2 E^2 ExpIntegralEi[-2 - 2 a x]))/(4 a^2)) C[1] *)

where ExpIntegralEi is the exponential integral function and C[1] is an arbitrary constant

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.