23.3.363 problem 367
Internal
problem
ID
[6077]
Book
:
Ordinary
differential
equations
and
their
solutions.
By
George
Moseley
Murphy.
1960
Section
:
Part
II.
Chapter
3.
THE
DIFFERENTIAL
EQUATION
IS
LINEAR
AND
OF
SECOND
ORDER,
page
311
Problem
number
:
367
Date
solved
:
Friday, October 03, 2025 at 01:46:09 AM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
\begin{align*} n \left (n +1\right ) y-2 x y^{\prime }+\left (-x^{2}+1\right ) y^{\prime \prime }&=\frac {2 \left (-1-n \right ) x \operatorname {LegendreP}\left (n , x\right )+2 \left (n +1\right ) \operatorname {LegendreP}\left (n +1, x\right )}{x^{2}-1} \end{align*}
✓ Maple. Time used: 0.092 (sec). Leaf size: 121
ode:=n*(n+1)*y(x)-2*x*diff(y(x),x)+(-x^2+1)*diff(diff(y(x),x),x) = 2*((-n-1)*x*LegendreP(n,x)+(n+1)*LegendreP(n+1,x))/(x^2-1);
dsolve(ode,y(x), singsol=all);
\[
y = \operatorname {LegendreP}\left (n , x\right ) c_2 +\operatorname {LegendreQ}\left (n , x\right ) c_1 -2 \int \frac {\operatorname {LegendreQ}\left (n , x\right ) \left (x \operatorname {LegendreP}\left (n , x\right )-\operatorname {LegendreP}\left (n +1, x\right )\right )}{\left (\operatorname {LegendreQ}\left (n +1, x\right ) \operatorname {LegendreP}\left (n , x\right )-\operatorname {LegendreP}\left (n +1, x\right ) \operatorname {LegendreQ}\left (n , x\right )\right ) \left (x^{2}-1\right )}d x \operatorname {LegendreP}\left (n , x\right )+2 \int \frac {\left (x \operatorname {LegendreP}\left (n , x\right )-\operatorname {LegendreP}\left (n +1, x\right )\right ) \operatorname {LegendreP}\left (n , x\right )}{\left (\operatorname {LegendreQ}\left (n +1, x\right ) \operatorname {LegendreP}\left (n , x\right )-\operatorname {LegendreP}\left (n +1, x\right ) \operatorname {LegendreQ}\left (n , x\right )\right ) \left (x^{2}-1\right )}d x \operatorname {LegendreQ}\left (n , x\right )
\]
✓ Mathematica. Time used: 0.735 (sec). Leaf size: 159
ode=n*(1 + n)*y[x] - 2*x*D[y[x],x] + (1 - x^2)*D[y[x],{x,2}] == (2*((-1 - n)*x*LegendreP[n, x] + (1 + n)*LegendreP[1 + n, x]))/(-1 + x^2);
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \operatorname {LegendreP}(n,x) \int _1^x\frac {2 (K[1] \operatorname {LegendreP}(n,K[1])-\operatorname {LegendreP}(n+1,K[1])) \operatorname {LegendreQ}(n,K[1])}{(K[1]-1) (K[1]+1) (\operatorname {LegendreP}(n+1,K[1]) \operatorname {LegendreQ}(n,K[1])-\operatorname {LegendreP}(n,K[1]) \operatorname {LegendreQ}(n+1,K[1]))}dK[1]+\operatorname {LegendreQ}(n,x) \int _1^x\frac {2 \operatorname {LegendreP}(n,K[2]) (\operatorname {LegendreP}(n+1,K[2])-K[2] \operatorname {LegendreP}(n,K[2]))}{(K[2]-1) (K[2]+1) (\operatorname {LegendreP}(n+1,K[2]) \operatorname {LegendreQ}(n,K[2])-\operatorname {LegendreP}(n,K[2]) \operatorname {LegendreQ}(n+1,K[2]))}dK[2]+c_1 \operatorname {LegendreP}(n,x)+c_2 \operatorname {LegendreQ}(n,x) \end{align*}
✗ Sympy
from sympy import *
x = symbols("x")
n = symbols("n")
y = Function("y")
ode = Eq(n*(n + 1)*y(x) - 2*x*Derivative(y(x), x) + (1 - x**2)*Derivative(y(x), (x, 2)) - (2*x*(-n - 1)*LegendreP(n, x) + 2*(n + 1)*LegendreP(n + 1, x))/(x**2 - 1),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE Derivative(y(x), x) - (n**2*x**2*y(x) - n**2*y(x) + n*x**2*y(x)