Function Repository Resource:

FrobeniusDSolveFormula

Source Notebook

Compute the formula for the Frobenius series solution to an ODE

Contributed by: Rauan Kaldybayev

ResourceFunction["FrobeniusDSolveFormula"][eqn,u,x,x0]

outputs a formula to be fed into the resource function FrobeniusDSolve.

ResourceFunction["FrobeniusDSolveFormula"][eqn,u,x,x0,Association]

outputs the formula for the Frobenius series solution of a differential equation for the function u, with independent variable x.

Details and Options

The output is a formula describing a Frobenius series . It is a list of the form {elem1,elem2,}, where the elemi gives information about the ith solution.
Solving ODEs using Frobenius's method is a tedious monotonous work, yet it is very simple - a perfect process to automate. ResourceFunction["FrobeniusDSolveFormula"] can be used to compute a formula for the Frobenius series solution to an ODE . Computing a Frobenius series solution by hand can lead to potential insights or be helpful in conceptually understanding the behavior of the solutions.
Another application for ResourceFunction["FrobeniusDSolveFormula"] is to assist the resource function FrobeniusDSolve. When solving an ODE, FrobeniusDSolve first utilizes ResourceFunction["FrobeniusDSolveFormula"] to compute a formula for the solution. The formula is then used to calculate the approximate solutions. When a single ODE is to be solved many times with different parameters, computation time can be significantly reduced by computing the formula separately, using ResourceFunction["FrobeniusDSolveFormula"]. (see Applications)
The function can be used to solve linear homogeneous ODEs with polynomial coefficients.
Any linear ODE with polynomial coefficients can be written in the form for some (any) x0. Frobenius's method assumes solution of the form ; substituting this into the equation yields , where . To satisfy the equation, the coefficients before all powers of x-x0 must be zero for all k. From here, we can determine the possible values of the constant r for which a00, and then for each r, compute the coefficients. Read more at the related Wolfram Community post.
The options for ResourceFunction["FrobeniusDSolveFormula"] are:
"ComputeError"Falsewhether to compute the error of the approximate solution

Examples

Basic Examples (2) 

Obtain a formula for the Frobenius solution for the ODE 2x2y''+7x(x+1)y'-3y=0 near the singular point x=0:

In[1]:=
ResourceFunction["FrobeniusDSolveFormula"][
 2 x^2 y''[x] + 7 x (x + 1) y'[x] - 3 y[x] == 0, y, x, 0, Association]
Out[1]=

The formula describes a Frobenius series . Display the same formula in a form compatible with the resource function FrobeniusDSolve (see Properties and Relations):

In[2]:=
ResourceFunction["FrobeniusDSolveFormula"][
 2 x^2 y''[x] + 7 x (x + 1) y'[x] - 3 y[x] == 0, y, x, 0]
Out[2]=

Scope (3) 

The function can operate with complex numbers:

In[3]:=
ResourceFunction[
 "FrobeniusDSolveFormula"][\[Psi]'[t] == I \[Psi][t], \[Psi], t, 0]
Out[3]=

The inputs of the function can be symbolics:

In[4]:=
ResourceFunction["FrobeniusDSolveFormula"][
 x'[t] + b x[t] == 0, x, t, 0]
Out[4]=

FrobeniusDSolveFormula can be used to solve ODEs of any order. Here is the formula for the Frobenius series solution to (x-1)4f''''[x]=x(2+x)f[x]+x2(x-1)2f''[x]-19(x-1)3f'''[x] near the singular point x=1:

In[5]:=
ResourceFunction[
 "FrobeniusDSolveFormula"][(x - 1)^4 f''''[x] == x (2 + x) f[x] + x^2 (x - 1)^2 f''[x] - 19 (x - 1)^3 f'''[x], f, x, 1]
Out[5]=

Options (1) 

If the option "ComputeError" is set to True, FrobeniusDSolveFormula will not only output a formula for the Frobenius series solution but also the formula for the error of this solution:

In[6]:=
ResourceFunction["FrobeniusDSolveFormula"][
 y''[x] + x^2 y[x] == 0, y, x, 0, "ComputeError" -> True]
Out[6]=

The formula doesn't make much sense to a human and instead is meant to be fed into the resource function FrobeniusDSolve, which will in turn compute an approximate solution of the form and the error of this solution.

Applications (2) 

FrobeniusDSolve is a related resource function that computes approximate Frobenius and power series solutions to ODEs. The solutions it outputs are of the form for some parameters x0, j. The following is an example of how FrobeniusDSolve can be used to obtain approximate solutions to the ODE x2y''-2xy'+(1+x)y=0 with x0=0 and n=4:

In[7]:=
FrobeniusDSolve[
 x^2 y''[x] - 2 x y'[x] + (1 + x) y[x] == 0, y, x, 0, 4]
Out[7]=

When solving an ODE, FrobeniusDSolve first utilizes FrobeniusDSolveFormula to compute a formula for the solution. The formula is then used to calculate the approximate solutions. When a single ODE is to be solved many times with different parameters, computation time can be significantly reduced by computing the formula separately, using FrobeniusDSolveFormula. This way, FrobeniusDSolve doesn't have to compute the formula every time, and it only has to do the numerical part of the computation. As can be seen from the following example, the decrease in computation time is dramatic:

In[8]:=
Block[{eqn = (y''[x] + (1 + x^2) y[x] == 0), ncoefs = 100, formula},
 	formula = ResourceFunction["FrobeniusDSolveFormula"][eqn, y, x, 0];
 	{1000 First@RepeatedTiming[FrobeniusDSolve[x, 0, ncoefs, formula]],
  	1000 First@RepeatedTiming[FrobeniusDSolve[eqn, y, x, 0, ncoefs]]}
 ]
Out[9]=

Properties and Relations (2) 

Formulas given by FrobeniusDSolveFormula can be fed into the resource function FrobeniusDSolve to compute approximate Frobenius series solutions. This can help significantly improve efficiency when a single ODE is to be solved repeatedly (see Applications). Obtain a formula for the Frobenius solution for the ODE 2x2y''+7x(x+1)y'-3y=0 near the singular point x=0, and output it in a form compatible with FrobeniusDSolve:

In[10]:=
formula = ResourceFunction["FrobeniusDSolveFormula"][
  2 x^2 y''[x] + 7 x (x + 1) y'[x] - 3 y[x] == 0, y, x, 0]
Out[10]=

Use the formula to compute two linearly independent approximate solutions :

In[11]:=
FrobeniusDSolve[x, 0, 10, formula]
Out[11]=
In[12]:=
Plot[#, {x, 0, 2}, ImageSize -> Medium, AxesLabel -> {"x", "y[x]"}] & /@ %
Out[12]=

Possible Issues (2) 

The ODE must be linear and homogeneous, and its coefficients must be polynomial. Otherwise, FrobeniusDSolveFormula returns $Failed:

In[13]:=
ResourceFunction[
 "FrobeniusDSolveFormula"][\[Theta]''[t] + Sin[\[Theta][t]] == 0, \[Theta], t, 0]
Out[13]=
In[14]:=
ResourceFunction["FrobeniusDSolveFormula"][y'[z] == 1, y, z, -3]
Out[14]=
In[15]:=
ResourceFunction["FrobeniusDSolveFormula"][
 u''[x] + Log[x] u[x] == u'[x], u, x, 2]
Out[15]=

If the ODE isn't liner but can be made so by dividing by a non-zero factor, the function still doesn't accept it:

In[16]:=
ResourceFunction[
 "FrobeniusDSolveFormula"][(1 + Abs[y[x]]) (y[x] + y''[x]) == 0, y, x, 0]
Out[16]=

Publisher

Wolfram Summer Camp

Version History

  • 1.0.0 – 13 April 2021

Source Metadata

Related Resources

License Information