%% Find Series Solution of Differential Equation
% Solve the second-order differential equation (x^2-1)^2\frac{\partial^2}{\partial x^2} y(x)+(x+1)\frac{\partial}{\partial x}  y(x) - y(x) = 0. dsolve returns a solution that contains a term with unevaluated integral.

syms y(x)
eqn = (x^2-1)^2*diff(y,2) + (x+1)*diff(y) - y == 0;
S = dsolve(eqn)

% To return series solutions of the differential equation around x = -1, set the 'ExpansionPoint' to -1. dsolve returns two linearly independent solutions in terms of a Puiseux series expansion.

S = dsolve(eqn,'ExpansionPoint',-1)

% Find other series solutions around the expansion point \infty by setting 'ExpansionPoint' to Inf.

S = dsolve(eqn,'ExpansionPoint',Inf)

% The default truncation order of the series expansion is 6. To obtain more terms in the Puiseux series solutions, set 'Order' to 8.

S = dsolve(eqn,'ExpansionPoint',Inf,'Order',8)

%
% Copyright 2019 The MathWorks, Inc.