Notebook[{ Cell["The Power Method with Summa.m", "Title"], Cell["Examples of manipulation of infinite series in ODEs", "Subtitle"], Cell[TextData[{ "Package \t\tSumma.m \tVersion\t2.4e\nAuthor\t\t\tPeltio \ (peltio@despammed.com)\nDevelopment \tinitially on 2.2.1, refined on 3.0 and \ 4.x\nDate\t\t\tMarch 2005\nNote\t\t\t", StyleBox[ "This notebook arose as a quick - and dirty - demonstration (actually it \ was more like\n\t\t\ta ", FontColor->GrayLevel[0.100008]], StyleBox["simia clicans", FontSlant->"Italic", FontColor->GrayLevel[0.100008]], StyleBox[ " kind of test) of the procedures for the manipulation of infinite and \ symbolic\n\t\t\tsums implemented in the package Summa.m. No effort has been \ done to verify the\n\t\t\trigor of the underlying mathematics.", FontColor->GrayLevel[0.100008]] }], "Copyright"], Cell["\<\ The main reason that prompted me to write the simple, almost naive, \ package Summa.m was to allow my lazy self to check, without significant \ effort, intermediate steps in the application of the power method to ordinary \ differential equations (ODE). Reindexing, collecting and simplification of \ sums are quite straigthforward but nonetheless tedious when performed by \ hand. Incidentally, such manipulations extend to other fields, different from \ ODE solving and a few examples are given in the notebook \"Application \ Examples\". Despite the fact that the package be rather crude (it allows only \ for simple manipulations, without exerting any sort of control on user input \ - so beware of what you ask it to do!) there are several possible \ applications. Starred sections are still partially unfinished.\ \>", "Text"], Cell[CellGroupData[{ Cell["Initialization", "Subsection"], Cell["First of all we load the package", "Text"], Cell["<True], Cell["\<\ Here's a list of the functions and tags implemented in the package:\ \ \>", "Text"], Cell[CellGroupData[{ Cell["?Summa`*", "Input"], Cell["\<\ AlignExponent Inside SumFullSimplifyEach AlignIndex IntegrateSum SumIndexAlign BreakSum Local SumIntegrate BringIn Numeric Summa BringOut ReindexSum SumMap DEachSum ReIndexSum SumMapAt DisableSumEvaluation Scope SummaToSum DSum SetSumFormat SumPosition EnableSumEvaluation SimplifyEachSum SumReIndex ExpandAllSum SimplifySum SumSimplify ExpandSum SumApply SumSimplifyEach Explode SumApplyAt SumSimplifySum Extent SumCoefficient SumSplit FullSimplifyEachSum SumD SumToSumma FullSimplifySum SumDEach SumToTerm GetCoefficient SumEvaluationStatus Symbolic GetElement SumExpand Verbose GetExponent SumExpandAll $EnableNumericSum Global SumExponentAlign $EnableSumEvaluation Inhibited SumFullSimplify\ \>", "Print", CellMargins->{{20, Inherited}, {Inherited, Inherited}}, ShowCellLabel->False, CellFrameMargins->{{Inherited, Inherited}, {14, 14}}, Background->GrayLevel[0.930022], ButtonBoxOptions->{Active->True}] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["What's new in version 2: setting the environment", "Subsection"], Cell[TextData[{ "After loading the package, built-in evauation of the function Sum is \ temporarily disabled. All symbolic and infinite sums (that is, sums with one \ or both non numeric endpoints) will be immediatly turned into Summa objects, \ allowing them to escape ", StyleBox["Mathematica'", FontSlant->"Italic"], "s evaluator. They will nonetheless continue to be formatted as ordinary \ Sum(s)" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(expr = Sum[k, {k, 1, n}]\), \(TableForm[{{InputForm[expr], OutputForm[expr]}}, TableHeadings \[Rule] {None, {"\", "\"}}]\)}], "Input"], Cell[BoxData[ FormBox[ TagBox[\(\[Sum]\+\(k = 1\)\%n k\), HoldForm], TraditionalForm]], "Output"], Cell[BoxData[ FormBox[ TagBox[GridBox[{ { FormBox["\<\"InputForm\"\>", "TraditionalForm"], FormBox["\<\"OutputForm\"\>", "TraditionalForm"]}, { InterpretationBox[ StyleBox[\(Summa[k, \ {k, \ 1, \ n}]\), ShowStringCharacters->True, NumberMarks->True], InputForm[ Summa[ k, {k, 1, n}]], Editable->True, AutoDelete->True], InterpretationBox[ FrameBox["\<\"Sum[k, {k, 1, n}]\"\>", BoxFrame->False, BoxMargins->False], OutputForm[ Summa[ k, {k, 1, n}]], Editable->False]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], (TableForm[ #, TableHeadings -> {None, {"InputForm", "OutputForm"}}]&)], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ This feature allows us to input sum(mma)s with the traditional \ notation used by Sum(s). They will be automatically converted into Summas and \ won't be evaluated.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(k = 0\)\%n k\)], "Input"], Cell[BoxData[ FormBox[ TagBox[\(\[Sum]\+\(k = 0\)\%n k\), HoldForm], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(InputForm[%]\)], "Input"], Cell["Summa[k, {k, 0, n}]", "Output"] }, Open ]], Cell["\<\ When we need to enable ordinary Sum evaluation we can do it locally (with \ respect to a cartain expression)\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(EnableSumEvaluation[expr]\)], "Input"], Cell[BoxData[ \(TraditionalForm\`1\/2\ n\ \((n + 1)\)\)], "Output"] }, Open ]], Cell["\<\ or globally, restoring the evaluation of Sum for all the input to \ come, by evalating the following command\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(EnableSumEvaluation[]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`"From now on not only all Sums, but also Summa objects with numerical \ endpoints will be passed to Mathematica for evaluation."\)], "Print"] }, Open ]], Cell[TextData[{ "We can see that every new Sum is treated as expected in a standard ", StyleBox["Mathematica", FontSlant->"Italic"], " fashion. There's a catch, though: previously inputted Sum[s] were turned \ into Summa[s] as soon as they were entered. So they need to be converted into \ Sum[s] by a direct replacement, if we want to see any effect." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Sum[k, {k, 1, n}]\)], "Input"], Cell[BoxData[ \(TraditionalForm\`1\/2\ n\ \((n + 1)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(expr /. Summa \[Rule] Sum\)], "Input"], Cell[BoxData[ \(TraditionalForm\`1\/2\ n\ \((n + 1)\)\)], "Output"] }, Open ]], Cell["The following disables Sum evaluation.", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DisableSumEvaluation[]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`"From now on Sums with Symbolic endpoints will be turned into Summa \ objects that will not be evaluated by Mathematica. Summa objects are \ formatted and shown as ordinary Sums (provided there are no explicit \ instructions to evaluate them)."\)], "Print"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["A note on SumCoefficient", "Subsection"], Cell["Version 3 understands this syntax", "Text"], Cell[BoxData[ \(SumCoefficient[expr, x^k]\)], "Input", Evaluatable->False], Cell["While on version 4 it is possible to use this form:", "Text"], Cell[BoxData[ \(SumCoefficient[%, x, k]\)], "Input", Evaluatable->False], Cell["\<\ So, if you are getting error messages while using getCoefficient, \ try to switch syntax: you are using the wrong one for your version. This will \ be fixed in future released of Summa. I apologize for the inconvenient.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Power method: ordinary points \ \>", "Section"], Cell[CellGroupData[{ Cell["Introduction to the power method", "Subsubsection"], Cell["\<\ The power method is based on the following theorem of \ existence:\ \>", "Text"], Cell[TextData[{ StyleBox["Theorem (existence and convergence of power solutions):", FontWeight->"Bold"], " Any ordinary differential equation in the form\n\t", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["y", \((n)\), MultilineFunction->None], "(", "x", ")"}], "+", \(\(s(x)\) \(\(y\^\((n - 1)\)\)(x)\)\), "+", RowBox[{\(p(x)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", \(\(q(x)\)\ \(y(x)\)\)}], "=", \(f(x)\)}], TraditionalForm]], "Text"], "\nwhose variable coefficients s(x), ..., p(x), q(x) and f(x) allow for a \ power series representation in a neighbor of the point ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], ", has a power series solution y(x)\n\t", Cell[BoxData[ \(TraditionalForm \`y(x) = \[Sum]\+\(k = 0\)\%\[Infinity]\(\( a\_k\)(x - x\_0)\)\^k\)]], "\nwhose convergence radius is as big as the smallest convergence radius of \ the series for the coefficients s(x),..., q(x) and f(x) seen as functions of \ a complex variable. An ordinary differential equation of the form ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{\(\[Alpha](x)\), RowBox[{ SuperscriptBox["y", \((n)\), MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{\(\[Beta](x)\), " ", RowBox[{ SuperscriptBox["y", \((n - 1)\), MultilineFunction->None], "(", "x", ")"}]}], "+"}], "..."}], "+", \(\(\[Gamma](x)\)\ \(y(x)\)\)}], "=", \(f(x)\)}], TraditionalForm]], "Text"], " can be translated into the previous form by dividing both sides by \ \[Alpha](x), provided that the coefficient of the highest derivative is not \ zero in ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], "." }], "Text", CellFrame->True, Background->GrayLevel[0.833326]], Cell[TextData[{ "Finding a power series solution to a differential equation means finding \ the general form for the coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_k\)]], ". This can be done by plugging the power series for y[x] and its \ derivatives into the equation (along with the power series for every variable \ coefficient, carrying out whatever calculation is needed to reduce the \ equation to a power series equated to zero, and by applying the principle of \ identity of polynomials to find the conditions to be imposed over the sum's \ coefficients ", Cell[BoxData[ \(TraditionalForm\`a\_0, \ a\_1, \ a\_2, \ \( ... , a\_k\), ... \)]], ". The first n relations (with n being the order of the differential \ equation) will need the specification of the initial conditions. Form the \ definition of power series it is easily shown that ", Cell[BoxData[ \(TraditionalForm\`a\_0 = y(x\_0)\)]], ", ", Cell[BoxData[ \(TraditionalForm\`a\_1 = y' \((x\_0)\)\)]], ", ", Cell[BoxData[ \(TraditionalForm\`a\_2 = \(y'\)' \((x\_0)\)/\(2!\)\)]], ", ..., ", Cell[BoxData[ \(TraditionalForm\`a\_j = y\^\((j)\)/\(j!\)\)]] }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["1. Solving y' == y", "Subsection"], Cell["\<\ Let's see how the method applies to the trivial ordinary \ differential equation\ \>", "Text"], Cell[BoxData[ \(\(eq = \(y'\)[x] - y[x] \[Equal] 0; \)\)], "Input"], Cell["\<\ This particular ODE's coefficients are simple constants (+1 and -1) \ so there is nothing to worry about the applicability of the power method. We \ choose to find a power series in a neighbor of x=0, thus limiting ourselves \ to a McLaurin series.We plug the power series and its first derivative into \ the original equation to get\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eq /. {y[x] \[Rule] \[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, \(y'\)[x] \[Rule] SumD[\[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, x]}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(k - 1\)\ a\_k\)}], HoldForm], "TraditionalForm"], "-", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Since we want to combine both sums into a single sum, we first need \ to change the index of summation with SumExponentAlign so that the terms will \ show the same power of x,and then we extract part of one of the two sums to \ make every index start form the same point. k=0, in this case. SumSplit is \ what we need for this task.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumExponentAlign[%, x, k \[Rule] k]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-x\^k\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = \(-1\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k + 1)\)\ x\^k\ a\_\(k + 1\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SumSplit[%, 0]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-x\^k\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k + 1)\)\ x\^k\ a\_\(k + 1\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ As an aside, note that nothing has changed, apart from the starting \ index of the first sum. The reason is that, being the derivative of a power \ series, its first term - the derivative of the constant term of the original \ series - is zero. Now that both sums have the same endpoints and involve the \ same power of x we can proceed in merging them into a single structure\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumSimplify[%]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \((\((k + 1)\)\ a\_\(k + 1\) - a\_k)\)\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "We're almost done. The sum is identically zero ", StyleBox["iff", FontSlant->"Italic"], " the coefficients of the power series are zero for every k. We have a \ relation to be imposed over the coefficents that can be solved for the \ coefficient with the highest index. On version 3 we use this:" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumCoefficient[%, x^k] \[Equal] 0\)], "Input"], Cell[BoxData[ \(TraditionalForm\`\(-a\_k\) + k\ a\_\(k + 1\) + a\_\(k + 1\) == 0\)], "Output"] }, Open ]], Cell["On version 4 this form is better:", "Text"], Cell[BoxData[ \(SumCoefficient[%, x, k] \[Equal] 0\)], "Input", Evaluatable->False], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[%, a\_\(k + 1\)]\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_\(k + 1\) \[Rule] a\_k\/\(k + 1\)}}\)], "Output"] }, Open ]], Cell["\<\ Now look at what we've got here: the next coefficient of the series \ expansion of the solution is given by the last computed coefficient divided \ by its index. We have to specify one coefficient to get the others, and this \ is just a way to specifiy which particular solution to pick among the \ infinitely many solutions of a first order differential equation.\ \>", "Text"], Cell[TextData[{ "We can express our solution in term of the first coefficient and, since ", Cell[BoxData[ \(TraditionalForm\`y(0) = a\_0\)]], " this is equivalent to specifying the initial condition ", Cell[BoxData[ \(TraditionalForm\`y\_0\)]], ". Let's see what happens to the first few coefficients and if we can find \ a closed form expression for the general coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]] }], "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t a\_0 = \(y\_0\n\ta\_1 = \(\(a\_0\ \((1\ 1\/1)\) = y\_0\)\n\ta\_2 = \(\(a\_1\/2 = \(a\_0\/\(2\ 1\) = y\_0\/\(2!\)\)\)\n\ta\_3 = \(\(a\_2\/3 = \(a\_0\/\(3\ 2\) = y\_0\/\(3!\)\)\)\n\t\[Ellipsis]\n \ta\_n = \(a\_\(n - 1\)\/n = y\_0\/\(n!\)\)\)\)\)\)\)\)], "Text"], Cell["Our power series solution is thus", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\[Sum]\+\(n = 0\)\%\[Infinity]\( y\_0\/\(n!\)\) x\^n // BringOut\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{\(y\_0\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\/\(n!\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "a sum converging for every x and a Sum that ", StyleBox["Mathematica", FontSlant->"Italic"], " knows very well. In fact locally enabling the built-in Sum evaluation \ will turn it into an exponential function, which is the known solution of the \ differential equation." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(EnableSumEvaluation[%]\)], "Input"], Cell[BoxData[ \(TraditionalForm\`\[ExponentialE]\^x\ y\_0\)], "Output"] }, Open ]], Cell[TextData[ "We have thus shown that the power series method has allowed us to compute \ the solution to the simple ODE y'\[Equal]y that is validated by our previous \ knowledge."], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["2. Solving y'' == y", "Subsection"], Cell["\<\ Let's use the power method to solve a second order linear ODE. \ Again we attack a simple problem whose solution is well known.\ \>", "Text"], Cell[BoxData[ \(\(eq = \(\(y'\)'\)[x] + y[x] \[Equal] 0; \)\)], "Input"], Cell["\<\ This ODE's coefficients are simple constants (+1 and -1) and we can \ apply the power method without problems. We choose to find a power series in \ a neighbor of x=0. Note that we can explicit the first two terms of the \ second derivative (they are zero) to get a neater expression\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = \[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, y2s = SumSplit[ SumD[\[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, {x, 2}], 2]}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], ",", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"]}], "}"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ If we plug the power series for our tentative solution y(x) and its \ second derivative into the equation, we get\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eq /. {y[x] \[Rule] ys, \(\(y'\)'\)[x] \[Rule] y2s}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Aligning the exponents of the powers of x has the effect of making \ the indices of both sums equal. A simplification will give us a single \ sum\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumExponentAlign[%, x, k \[Rule] k] // SumSimplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \((a\_k + \((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\))\)\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "For this equality to be true, it is necessary (and sufficient) that the \ coefficient of ", Cell[BoxData[ \(TraditionalForm\`x\^k\)]], "be zero for every (non negative) k. Equating this coefficient to zero and \ solving for ", Cell[BoxData[ \(TraditionalForm\`a\_\(k + 2\)\)]], "yields the recursion relation we're after" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumCoefficient[%, x^k] \[Equal] 0\)], "Input"], Cell[BoxData[ \(TraditionalForm \`a\_\(k + 2\)\ k\^2 + 3\ a\_\(k + 2\)\ k + a\_k + 2\ a\_\(k + 2\) == 0 \)], "Output"] }, Open ]], Cell[TextData["On version 4 we'd use SumCoefficient[%,x,k]\[Equal]0"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[%, a\_\(k + 2\)] /. k \[Rule] k - 2 // Simplify\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_k \[Rule] a\_\(k - 2\)\/\(k - k\^2\)}}\)], "Output"] }, Open ]], Cell[TextData[{ "This recursion relation will generate every coefficient of the power \ series that satisfies the differential equation, once the first two \ coefficients are known. It is easy to see that their values are related to \ the values of the solutions in x=0, namely ", Cell[BoxData[ \(TraditionalForm\`y(0) = a\_0\)]], "and ", Cell[BoxData[ \(TraditionalForm\`y' \((0)\) = a\_1\)]], ". " }], "Text"], Cell[TextData[{ "Let's see if we can find a closed form expression for the general \ coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], ". We can identify two separate sequences whose numerical coefficients are \ related to the factorial of the index" }], "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", GridBox[{ {\(a\_0 = y\_0\), " ", \(a\_1 = yp\_0\)}, { \(a\_2 = \(\(-\(a\_0\/2\)\) = \(\(-\(y\_0\/2\)\) = \(-\(y\_0\/\(2!\)\)\)\)\)\), " ", \(a\_3 = \(\(-\(a\_1\/6\)\) = \(\(-\(yp\_0\/6\)\) = \(-\(yp\_0\/\(3!\)\)\)\)\)\)}, {\(a\_4 = \(\(-\(a\_2\/12\)\) = \(y\_0\/24 = y\_0\/\(4!\)\)\)\), " ", \(a\_5 = \(\(-\(a\_3\/20\)\) = \(yp\_0\/120 = yp\_0\/\(5!\)\)\)\)}, { \(a\_6 = \(\(-\(a\_4\/30\)\) = \(\(-\(y\_0\/720\)\) = \(-\(y\_0\/\(6!\)\)\)\)\)\), " ", \(a\_7 = \(\(-\(a\_5\/42\)\) = \(\(-\(yp\_0\/5040\)\) = \(-\(yp\_0\/\(7!\)\)\)\)\)\)}, {"\[Ellipsis]", " ", "\[Ellipsis]"} }], "\[NoBreak]"}], TraditionalForm]], "Text", GridBoxOptions->{ColumnAlignments->{Left}}], Cell["\<\ The pattern is clearly identified and a little background in \ calculus allows us to spot the coefficients of the McLaurin expansion of the \ elementary trigonometric functions Cos and Sin.\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", GridBox[{ {\(a\_\(2\ n\) = \(\((\(-1\))\)\^n\ y\_0\)\/\(\((2\ n)\)!\)\), " ", \(a\_\(2\ n + 1\) = \(\((\(-1\))\)\^n\ yp\_0\)\/\(\((2\ n + 1)\)!\)\)} }]}], TraditionalForm]], "Text"], Cell["\<\ We can then write the power series solution in the following way:\ \ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t y(x)\[AlignmentMarker] = y\_0\ \(\[Sum]\+\(n = 0\)\%\[Infinity]\(\((\(-1\))\)\^n\ x\^\(2\ n\)\)\/\(\((2\ n)\)!\)\) + yp\_0\ \(\[Sum]\+\(n = 0\)\%\[Infinity]\(\((\(-1\))\)\^n\ x\^\(2\ n + 1\)\)\/\(\((2\ n + 1)\)! \)\)\[IndentingNewLine]\( = \(y\_0\) \(cos(x)\) + \(yp\_0\) \(sin(x)\)\)\)\)], "Text", TextAlignment->AlignmentMarker], Cell[TextData[{ "Taken separately, the two sums are particular solutions of the \ differential equation; the first one is the solution with initial conditions \ ", Cell[BoxData[ \(TraditionalForm\`y(0) = 1\)]], "and ", Cell[BoxData[ \(TraditionalForm\`y' \((0)\) = 0\)]], ", while the second one is a solution for ", Cell[BoxData[ \(TraditionalForm\`y(0) = 0\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y' \((0)\) = 1\)]], ". Since the first power series contains only even powers of x and the \ latter only odd powers, they are also linearly independent. If we consider ", Cell[BoxData[ \(TraditionalForm\`y\_0\)]], "and ", Cell[BoxData[ \(TraditionalForm\`yp\_0\)]], "as arbitrary constants, then we have found the general solution to our \ ODE." }], "Text"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can verify for us that we have found the correct solution. We need to \ enable built-in Sum evaluation before calling DSolve, though. By wrapping \ EnableSumEvaluation around DSolve we can show that the particular solution \ with initial onditions ", Cell[BoxData[ \(TraditionalForm\`y(0) = y\_0\)]], "and ", Cell[BoxData[ \(TraditionalForm\`y' \((0)\) = yp\_0\)]], "is " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[{\[IndentingNewLine]\(\(y'\)'\)[x] + y[x] \[Equal] 0, \[IndentingNewLine]y[0] \[Equal] yo, \(y'\)[0] \[Equal] ypo\[IndentingNewLine]}, y[x], x] // EnableSumEvaluation\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{y(x) \[Rule] yo\ \(cos(x)\) + ypo\ \(sin(x)\)}}\)], "Output"] }, Open ]], Cell["\<\ and has the same form as the well known general solution found for \ a constant coefficient ODE, and by NDSolve\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[\(\(y'\)'\)[x] + y[x] \[Equal] 0, y[x], x] // EnableSumEvaluation \)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{"{", RowBox[{\(y(x)\), "\[Rule]", RowBox[{ RowBox[{ SubscriptBox[ TagBox["c", C], "2"], " ", \(cos(x)\)}], "-", RowBox[{ SubscriptBox[ TagBox["c", C], "1"], " ", \(sin(x)\)}]}]}], "}"}], "}"}], TraditionalForm]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["3. Solving (4-x^2)y'[x]+y[x]==0", "Subsection"], Cell["\<\ Most functions in the Summa package can operate directly over \ equations in the form lhs==rhs, as we shall see n the next example. We can \ obviosly work by addressing only the left hand side, as in this example. Here \ is the lhs of the ODE to solve:\ \>", "Text"], Cell["eq=(4-x^2)y'[x]+y[x];", "Input"], Cell["\<\ We can find a power series solution as long as we stay clear form \ the points x=-2 and x=+2. The tentative power series solution and its \ derivatives, expanded in a neighbor of x=0, are\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = Sum[\(a\_n\) x^n, {n, 0, Infinity}], \[IndentingNewLine]y1s = SumD[ys, x], \[IndentingNewLine]y2s = SumD[y1s, x]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ n\ x\^\(n - 2\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ n, Power[ x, Plus[ -1, n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ -1, n], n, Power[ x, Plus[ -2, n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["By plugging them into the equation we get", "Text"], Cell[CellGroupData[{ Cell["eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\((4 - x\^2)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's expand the products and bring the factors inside the \ sums\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=BringIn[SumExpand[eqs]]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ n\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-n\)\ x\^\(n + 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "It would be better to have all the power in the form ", Cell[BoxData[ \(TraditionalForm\`x\^n\)]], ": To achieve this goal we can use the function SumExponentAlign \ (previously named AlignExponent) in the following way (the third argument is \ in the form (", StyleBox["name of the exponent", FontSlant->"Italic"], ")\[Rule](", StyleBox["form into which has to be cast", FontSlant->"Italic"], ") )" }], "Text"], Cell[CellGroupData[{ Cell["eqs=SumExponentAlign[eqs,x,n->n]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n - 1)\)\)\ x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-1\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ \((n + 1)\)\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Then we try to get sums that have the same starting value, without \ tampering with the indexes any more: we use SumSplit (BreakSum) to get the \ exceeding terms out of the sums. This command will make all the sums starting \ from 1\ \>", "Text"], Cell[CellGroupData[{ Cell["SumSplit[eqs,1]", "Input"], Cell[BoxData[ FormBox[ RowBox[{\(a\_0\), "+", \(4\ a\_1\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n - 1)\)\)\ x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ \((n + 1)\)\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's simplify this expression, compacting all the sum into a \ single one. SumSimplify (the late SimplifySum) does this for us:\ \>", "Text"], Cell[CellGroupData[{ Cell["res=SumSimplify[%]", "Input"], Cell[BoxData[ FormBox[ RowBox[{\(a\_0\), "+", \(4\ a\_1\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ \(( \(-\((n - 1)\)\)\ a\_\(n - 1\) + a\_n + 4\ \((n + 1)\)\ a\_\(n + 1\))\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now all we have to do is to apply the principle of identity of \ polynomials. This can be done as follows: We first suppress the Sum[_ , it] structure with SumToTerm (the procedure \ formerly known as GetElement)\ \>", "Text"], Cell[CellGroupData[{ Cell["eqRicors=SumToTerm[res]", "Input"], Cell[BoxData[ \(TraditionalForm \`\((\(-\((n - 1)\)\)\ a\_\(n - 1\) + a\_n + 4\ \((n + 1)\)\ a\_\(n + 1\)) \)\ x\^n + a\_0 + 4\ a\_1\)], "Output"] }, Open ]], Cell[TextData[{ "And then we can equate the coefficients of ", Cell[BoxData[ \(TraditionalForm\`x\^n\)]], " and ", Cell[BoxData[ \(TraditionalForm\`x\^0\)]], " to zero, solving for the unknown coefficients ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], ". It may be necessary to translate the index variable and simplify the \ result." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {cn} = Solve[SumCoefficient[eqRicors, x^n] == 0, a\_\(n + 1\)] /. n -> n - 1 // Simplify\)\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{{a\_n \[Rule] \(\((n - 2)\)\ a\_\(n - 2\) - a\_\(n - 1\)\)\/\(4\ n\)}} \)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {c1} = Solve[SumCoefficient[eqRicors, x, 0] == 0, a\_1]\)\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_1 \[Rule] \(-\(a\_0\/4\)\)}}\)], "Output"] }, Open ]], Cell["\<\ Alternatively we could have used the built-in function Coefficient.\ \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {c1} = Solve[\((Coefficient[res, x, 0] /. _Summa -> 0)\) == 0, a\_1]\)\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_1 \[Rule] \(-\(a\_0\/4\)\)}}\)], "Output"] }, Open ]], Cell["\<\ Now we just have to construct the series, given the recursion \ relation. \ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t a\_0 = \(\(y(0)\)\n\ta\_1 = \(\(-\(a\_0\/4\)\)\n\ta\_n = \(\((n - 2)\)\ a\_\(n - 2\) - a\_\(n - 1\)\)\/\(4\ n\)\)\)\)\)], "Text"], Cell["\<\ But that's another story...(see section \"Building power series \ from recursion relations\")\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["4. Solving (4+x^2)y'[x]+y[x]==0", "Subsection"], Cell["\<\ The same thing we did with the right hand side of the equation can \ be carried on with the whole equation: being essentialy rule-based, Summa \ manipulations procedures get mapped inside the Equal structure. Let's start \ with the equation\ \>", "Text"], Cell[CellGroupData[{ Cell["eq=(4+x^2)y'[x]+y[x]==0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(y(x)\), "+", RowBox[{\((x\^2 + 4)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ As usual we build the power series expansions around our ordinary \ point (x=0). We choose to explicitate the first zero coefficients of the \ derivatives.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ Clear[ys, y1s, y2s, a]\n{ ys = \[Sum]\+\(n = 0\)\%\[Infinity]\( a\_n\) x\^n, \[IndentingNewLine]y1s = SumSplit[SumD[ys, x], 1], \[IndentingNewLine]y2s = SumSplit[SumD[y1s, x], 2]} // ColumnForm \)\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ n\ x\^\(n - 2\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ n, Power[ x, Plus[ -1, n]], Subscript[ a, n]], {n, 1, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ -1, n], n, Power[ x, Plus[ -2, n]], Subscript[ a, n]], {n, 2, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["Substitution into the original equation yields", "Text"], Cell[CellGroupData[{ Cell["eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\((x\^2 + 4)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["As before we expand and bring the factors in ", "Text"], Cell[CellGroupData[{ Cell["eqs=BringIn[SumExpand[eqs]]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ n\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n + 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ then we align exponents and starting point by reindexing and \ element extraction\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExponentAlign[eqs,x,n->n] SumSplit[eqs,1]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ \((n + 1)\)\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(a\_0\), "+", \(4\ a\_1\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ \((n + 1)\)\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "Simplification and solving are what's left to do. Here we use another \ method to extract the coefficient of ", Cell[BoxData[ \(TraditionalForm\`x\^0\)]] }], "Text"], Cell[CellGroupData[{ Cell["res=SumSimplify[%]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(a\_0\), "+", \(4\ a\_1\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ \(( \((n - 1)\)\ a\_\(n - 1\) + a\_n + 4\ \((n + 1)\)\ a\_\(n + 1\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[SumCoefficient[res, x^n] == 0, a\_\(n + 1\)] /. n -> n - 1 // Simplify\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{{a\_n \[Rule] \(-\(\(\((n - 2)\)\ a\_\(n - 2\) + a\_\(n - 1\)\)\/\(4\ n\)\)\)}} \)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[res /. _Summa -> 0, a\_1]\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_1 \[Rule] \(-\(a\_0\/4\)\)}}\)], "Output"] }, Open ]], Cell["\<\ This is the recursion relation that allow ys to compute every \ coefficient in the power series of the solution around x=0..\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t a\_0 = \(\(y(0)\)\n\ta\_1 = \(\(-\(a\_0\/4\)\)\n\ta\_n = \(\((n - 2)\)\ a\_\(n - 2\) + a\_\(n - 1\)\)\/\(4\ n\)\)\)\)\)], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["5. Solving (x+1)y''[x]+y'[x]+x y[x]==0", "Subsection"], Cell["", "Text"], Cell[CellGroupData[{ Cell["eq=(x+1)y''[x]+y'[x]+x y[x]==0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(x\ \(y(x)\)\), "+", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], "+", RowBox[{\((x + 1)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We are looking for a solution in the form of power series. Fuchs' \ theorem assures us that such a solution exist as long as we stay clear from \ the point x=-1, that makes the coefficient of the highest derivative zero. \ The function and its derivatives are\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = Sum[\(a\_n\) x^n, {n, 0, Infinity}], y1s = DSum[ys, x], y2s = DSum[y1s, x]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ n\ x\^\(n - 2\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ n, Power[ x, Plus[ -1, n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ -1, n], n, Power[ x, Plus[ -2, n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We choose to ignore the fact that the derivatives can be further \ simplified by acounting for their first null terms. Substituting these \ espressions in the original equation we get:\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\((x + 1)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ n\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{"x", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's expand the fist term, bringing all the factors inside the \ sums\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=SumExpand[BringIn[eqs]]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"-", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "We're trying to ge all the sums with terms having the same form for the \ power of x, namely ", Cell[BoxData[ \(TraditionalForm\`\(c\_n\) x\^n\)]], ": to achieve this goal we call SumExponentAlign, in this way (the third \ argument is in the form (", StyleBox["name of the index", FontSlant->"Italic"], ")\[Rule](", StyleBox["form into which it has to be cast", FontSlant->"Italic"], ") )" }], "Text"], Cell[CellGroupData[{ Cell["eqs=SumExponentAlign[eqs,x,n->n]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-1\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1)\)\^2\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n + 2)\)\)\ x\^n\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\^2\ x\^n\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Then we try to get sums that have the same starting value, without \ tampering with the indexes any more: we use SumSplit to get the exceeding \ terms out of the sums. This command will make all the sums starting from \ 1\ \>", "Text"], Cell[CellGroupData[{ Cell["SumSplit[eqs,1]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(a\_1\), "+", \(2\ a\_2\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1)\)\^2\ x\^n\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n + 2)\)\)\ x\^n\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\^2\ x\^n\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's simplify this expression, compacting all the sum into a \ single one\ \>", "Text"], Cell[CellGroupData[{ Cell["res=SumSimplify[%]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(a\_1\), "+", \(2\ a\_2\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ \(( a\_\(n - 1\) + \((n + 1)\)\ \((\((n + 1)\)\ a\_\(n + 1\) + \((n + 2)\)\ a\_\(n + 2\))\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now all we have to do is to apply the principle of identity of \ polynomials. This can be done as follows: This suppresses the Sum[ , it] structure giving us an equation than can be \ used to find the relationship between the coefficients of the power series of \ the solution\ \>", "Text"], Cell[CellGroupData[{ Cell["eqRicors=GetElement[res]", "Input"], Cell[BoxData[ \(TraditionalForm \`\((a\_\(n - 1\) + \((n + 1)\)\ \((\((n + 1)\)\ a\_\(n + 1\) + \((n + 2)\)\ a\_\(n + 2\))\)) \)\ x\^n + a\_1 + 2\ a\_2 == 0\)], "Output"] }, Open ]], Cell[TextData[{ "And then we can equate the coefficients of ", Cell[BoxData[ \(TraditionalForm\`x\^0\)]], " and ", Cell[BoxData[ \(TraditionalForm\`x\^n\)]], " to zero, solving for the unknown coefficients ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], ". A shift in the index and a further simplification will yield a neat \ expression for the general coefficient with n>2." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {c1} = Solve[Coefficient[eqRicors[\([1]\)], x, 0] == 0, a\_2]\)\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{{a\_2 \[Rule] \(-\(a\_1\/2\)\)}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {cn} = Solve[Coefficient[eqRicors[\([1]\)], x, n] == 0, a\_\(n + 2\)] /. n -> n - 2 // Simplify\)\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{{a\_n \[Rule] \(-\(\(a\_\(n - 1\)\ \((n - 1)\)\^2 + a\_\(n - 3\)\)\/\(\((n - 1)\)\ n\)\)\)}}\)], "Output"] }, Open ]], Cell[TextData[{ "We have no formula for the first two coefficients a0 and a1, and that is \ all right since for a second order ODE the general solution happens to depend \ upon two parameters. In this case it easy to see, by inspecting the power \ series for y[x] and y'[x], that ", Cell[BoxData[ \(TraditionalForm\`a\_0 = y(0)\)]], " and ", Cell[BoxData[ \(TraditionalForm\`a\_1 = y' \((0)\)\)]], ". Every coefficient of the power series can then by computed according to \ the following relationships" }], "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{\(a\_0 = y(0)\), "\n", "\t", RowBox[{\(a\_1\), "=", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}]}], "\n", "\t", \(a\_2 = \(-\(a\_1\/2\)\)\), "\n", "\t", \(a\_n = \(-\(\(a\_\(n - 1\)\ \((n - 1)\)\^2 + a\_\(n - 3\)\)\/\(\((n - 1)\)\ n\)\)\)\)}]}], TraditionalForm]], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Building power series from recursion relations", "Subsection"], Cell["\<\ We have applied the Summa procedures to reach a symbolic recursive \ form for the coefficients of the power series solution of our ODEs. We might \ also want to make this solution a little bit less ethereal and getting down \ to numbers. While there are more efficient techiniques to do this right away \ by starting form the equation, the following shows how to avoid recursion \ errors in handling the coefficient expression. Let's focus on the last equation's solution:\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{ RowBox[{ RowBox[{\((x + 1)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], "+", \(x\ \(y(x)\)\)}], "=", "0"}]}], TraditionalForm]], "Text"], Cell["\<\ The recursion relation for the coefficients of the power series for \ y(x) is\ \>", "Text"], Cell[TextData[{ "\t", Cell[BoxData[ \(TraditionalForm\`a\_2 = \(-\(a\_1\/2\)\)\)]], "\n\t", Cell[BoxData[ \(TraditionalForm \`a\_n = \(- \(\(a\_\(n - 1\)\ \((n - 1)\)\^2 + a\_\(n - 3\)\)\/\(\((n - 1)\)\ n \)\)\)\)]] }], "Text"], Cell["\<\ We have to specify the value of the first two coefficients. We can \ do that by imposing initial conditions. Since\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{\(y(0) = a\_0\), "\n", "\t", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}], "=", \(a\_1\)}]}]}], TraditionalForm]], "Text"], Cell[TextData[{ "Imposing the I.C.y[0=]=1 and y'[0]=0 will result in choosing the first two \ coefficients as ", Cell[BoxData[ \(TraditionalForm\`a\_0\)]], "= 1 and ", Cell[BoxData[ \(TraditionalForm\`a\_1\)]], "= 0 We have enough information to compute the whole sequence of \ coefficients" }], "Text"], Cell[BoxData[{ \(\(al[0] = 1; \)\), \(\n\), \(\(al[1] = 0; \)\), \(\n\), \(\(al[2] = \(-al[1]\)/2; \)\), \(\n\), \(al[n_\ /; n > 2] := \(al[n] = \(-\(\(al[n - 1]\ \((n - 1)\)\^2 + al[n - 3]\)\/\(\((n - 1)\)\ n \)\)\)\)\)}], "Input"], Cell["\<\ Please note that the general recursion relation stores the computed \ values so that it won't be necessary to repeat their calculation for every \ new coefficient. Here are the first ten coefficients\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[al[k], {k, 0, 9}]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{1, 0, 0, \(-\(1\/6\)\), 1\/8, \(-\(1\/10\)\), 4\/45, \(-\(19\/240\)\), 191\/2688, \(-\(2921\/45360\)\)}\)], "Output"] }, Open ]], Cell["\<\ The truncated series is easily computed as a scalar product with \ the vector of integer powers of x. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(f[x_] = % . Table[x^k, {k, 0, 9}]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`\(-\(\(2921\ x\^9\)\/45360\)\) + \(191\ x\^8\)\/2688 - \(19\ x\^7\)\/240 + \(4\ x\^6\)\/45 - x\^5\/10 + x\^4\/8 - x\^3\/6 + 1 \)], "Output"] }, Open ]], Cell["\<\ And we can see that it does indeed satisfy the given initial \ conditions (passing by the point (0,1) with zero slope). Obviously, this \ being a series approximation of the actual exact solution, it will be a good \ substitute for it only in a reasonably small neighbor of x=0. Also remember \ that the power series solution we have found is not good in a neighbor of the \ point x=-1 Let's compare it to the exact solution:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(g[x_] = y[x] /. \(DSolve[{ \((x + 1)\) \(\(y'\)'\)[x] + \(y'\)[x] + x\ y[x] \[Equal] 0, \[IndentingNewLine]y[0] == 1, \(y'\)[0] == 0}, y[x], x]\)[ \([1]\)] // EnableSumEvaluation\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"-", RowBox[{ RowBox[{"(", RowBox[{ \((1\/2 + \[ImaginaryI]\/2)\), " ", \(\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ x\)\), " ", RowBox[{"(", RowBox[{ RowBox[{ "2", " ", \(\(L\_\(\(-\(3\/2\)\) + \[ImaginaryI]\/2\)\%1\)( 2\ \[ImaginaryI])\), " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\ x + 2\ \[ImaginaryI]\), ")"}]}], "+", RowBox[{ \(\(L\_\(\(-\(1\/2\)\) + \[ImaginaryI]\/2\)\)( 2\ \[ImaginaryI])\), " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\ x + 2\ \[ImaginaryI]\), ")"}]}], "-", RowBox[{\((1 - \[ImaginaryI])\), " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}], " ", \(\(L\_\(\(-\(1\/2\)\) + \[ImaginaryI]\/2\)\)( 2\ \[ImaginaryI]\ x + 2\ \[ImaginaryI])\)}], "-", RowBox[{ RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}], " ", \(\(L\_\(\(-\(1\/2\)\) + \[ImaginaryI]\/2\)\)( 2\ \[ImaginaryI]\ x + 2\ \[ImaginaryI])\)}]}], ")"}]}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}], " ", \(\(L\_\(\(-\(1\/2\)\) + \[ImaginaryI]\/2\)\)( 2\ \[ImaginaryI])\)}], "-", RowBox[{\((1 + \[ImaginaryI])\), " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}], " ", \(\(L\_\(\(-\(3\/2\)\) + \[ImaginaryI]\/2\)\%1\)( 2\ \[ImaginaryI])\)}]}], ")"}]}]}], TraditionalForm]], "Output"] }, Open ]], Cell[BoxData[{ \(\(Block[{$DisplayFunction = Identity}, \[IndentingNewLine]exactSol = Plot[g[x], {x, \(-1\), 1}, Frame \[Rule] True]; seriesSol = Plot[f[x], {x, \(-1\), 1}, PlotStyle \[Rule] Dashing[{ .01, .02}]]; \[IndentingNewLine]]; \)\), \(\[IndentingNewLine]\), \(\(Show[exactSol, seriesSol]; \)\)}], "Input"], Cell["\<\ Plotting the error with full range, will show that x=-1 is indeed \ problematic:\ \>", "Text"], Cell[BoxData[ \(\(Plot[g[x] - f[x], {x, \(-1\), 1}, Frame \[Rule] True, PlotRange \[Rule] All]; \)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Building a truncated power series right from the equation (*)\ \>", "Subsection"], Cell["\<\ If we are seeking for a finite truncaton of the infinite series \ expansion of the solution, we could apply a different technique, far more \ straightforward and efficient. What follows has been adapted from posts in \ the MathGroup.\ \>", "Text"], Cell[CellGroupData[{ Cell["The long way (*)", "Subsubsection"], Cell["Consider the differential equation", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((t\ + \ 1)\)*\(\(y'\)'\)[t]\ + \ \(y'\)[\ t]\ + \ t\ y[t] \[Equal] 0\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(t\ \(y(t)\)\), "+", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "t", ")"}], "+", RowBox[{\((t + 1)\), " ", RowBox[{ SuperscriptBox["y", "\[DoublePrime]", MultilineFunction->None], "(", "t", ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ This is the differential operator associated to that equation\ \>", "Text"], Cell[BoxData[ StyleBox[ \(T[y_]\ := \ \((t\ + \ 1)\)*D[y, \ t, \ t]\ + \ D[y, \ t]\ + \ t*y; \), FormatType->StandardForm]], "Input"], Cell["We look for a solution whose taylor expansion is", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\ty(t) = \[Sum]\+\(k = 0\)\%n a\_k\ t\^k\)\)], "Text"], Cell["If we content ourselves with a maximum of 9 terms, we have", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox[\(n\ = \ 9\), FormatType->StandardForm], StyleBox[";", FormatType->StandardForm], "\n", \(y = Sum[a[k] t^k, {k, 0, 9}]\)}]], "Input"], Cell[BoxData[ \(TraditionalForm \`\(a(9)\)\ t\^9 + \(a(8)\)\ t\^8 + \(a(7)\)\ t\^7 + \(a(6)\)\ t\^6 + \(a(5)\)\ t\^5 + \(a(4)\)\ t\^4 + \(a(3)\)\ t\^3 + \(a(2)\)\ t\^2 + \(a(1)\)\ t + a(0)\)], "Output"] }, Open ]], Cell["\<\ If we plug this expression in the differential operator we get\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ StyleBox[\(terms\ = \ Simplify[T[y]]\), FormatType->StandardForm]], "Input"], Cell[BoxData[ \(TraditionalForm \`\(a(9)\)\ t\^10 + \(a(8)\)\ t\^9 + \((a(7) + 81\ \(a(9)\))\)\ t\^8 + \((a(6) + 64\ \(a(8)\) + 72\ \(a(9)\))\)\ t\^7 + \((a(5) + 49\ \(a(7)\) + 56\ \(a(8)\))\)\ t\^6 + \((a(4) + 36\ \(a(6)\) + 42\ \(a(7)\))\)\ t\^5 + \((a(3) + 25\ \(a(5)\) + 30\ \(a(6)\))\)\ t\^4 + \((a(2) + 16\ \(a(4)\) + 20\ \(a(5)\))\)\ t\^3 + \((a(1) + 9\ \(a(3)\) + 12\ \(a(4)\))\)\ t\^2 + \((a(0) + 4\ \(a(2)\) + 6\ \(a(3)\))\)\ t + a(1) + 2\ \(a(2)\)\)], "Output"] }, Open ]], Cell["\<\ By equating this to zero and by aspplying the principle of identity \ of polinomyals we can get a system of equations giving the value of the \ coefficients\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ StyleBox[ \(Tycoeffs\ = \ \(CoefficientList[terms, \ t]\)[\([Range[n\ - \ 1]]\)]\), FormatType->StandardForm]], "Input"], Cell[BoxData[ \(TraditionalForm \`{a(1) + 2\ \(a(2)\), a(0) + 4\ \(a(2)\) + 6\ \(a(3)\), a(1) + 9\ \(a(3)\) + 12\ \(a(4)\), a(2) + 16\ \(a(4)\) + 20\ \(a(5)\), a(3) + 25\ \(a(5)\) + 30\ \(a(6)\), a(4) + 36\ \(a(6)\) + 42\ \(a(7)\), a(5) + 49\ \(a(7)\) + 56\ \(a(8)\), a(6) + 64\ \(a(8)\) + 72\ \(a(9)\)} \)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(", StyleBox[\(eqns\ = \ Map[\((#\ == \ 0)\)\ &, \ Tycoeffs]\), FormatType->StandardForm], StyleBox[")", FormatType->StandardForm]}], StyleBox["//", FormatType->StandardForm], StyleBox["ColumnForm", FormatType->StandardForm]}]], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(a(1) + 2\ \(a(2)\) == 0\)}, {\(a(0) + 4\ \(a(2)\) + 6\ \(a(3)\) == 0\)}, {\(a(1) + 9\ \(a(3)\) + 12\ \(a(4)\) == 0\)}, {\(a(2) + 16\ \(a(4)\) + 20\ \(a(5)\) == 0\)}, {\(a(3) + 25\ \(a(5)\) + 30\ \(a(6)\) == 0\)}, {\(a(4) + 36\ \(a(6)\) + 42\ \(a(7)\) == 0\)}, {\(a(5) + 49\ \(a(7)\) + 56\ \(a(8)\) == 0\)}, {\(a(6) + 64\ \(a(8)\) + 72\ \(a(9)\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ a[ 1], Times[ 2, a[ 2]]], 0], Equal[ Plus[ a[ 0], Times[ 4, a[ 2]], Times[ 6, a[ 3]]], 0], Equal[ Plus[ a[ 1], Times[ 9, a[ 3]], Times[ 12, a[ 4]]], 0], Equal[ Plus[ a[ 2], Times[ 16, a[ 4]], Times[ 20, a[ 5]]], 0], Equal[ Plus[ a[ 3], Times[ 25, a[ 5]], Times[ 30, a[ 6]]], 0], Equal[ Plus[ a[ 4], Times[ 36, a[ 6]], Times[ 42, a[ 7]]], 0], Equal[ Plus[ a[ 5], Times[ 49, a[ 7]], Times[ 56, a[ 8]]], 0], Equal[ Plus[ a[ 6], Times[ 64, a[ 8]], Times[ 72, a[ 9]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now solve for the coefficients in the solution satisfying y[0]=1, \ y'[0]=0. The initial conditions give us two more equations in the \ coefficients of the series expansion\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({y \[Equal] 1, D[y, t] \[Equal] 0} /. t \[Rule] 0\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{a(0) == 1, a(1) == 0}\)], "Output"] }, Open ]], Cell["\<\ We append these two further equations to those we already had, to \ have a system of 10 equations in 10 unknowns, whose solution is\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((ycoeffs1 = First[Solve[Join[%, eqns], Table[a[i], {i, 0, n}]]])\) // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(a(0) \[Rule] 1\)}, {\(a(1) \[Rule] 0\)}, {\(a(2) \[Rule] 0\)}, {\(a(3) \[Rule] \(-\(1\/6\)\)\)}, {\(a(4) \[Rule] 1\/8\)}, {\(a(5) \[Rule] \(-\(1\/10\)\)\)}, {\(a(6) \[Rule] 4\/45\)}, {\(a(7) \[Rule] \(-\(19\/240\)\)\)}, {\(a(8) \[Rule] 191\/2688\)}, {\(a(9) \[Rule] \(-\(2921\/45360\)\)\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {a[ 0] -> 1, a[ 1] -> 0, a[ 2] -> 0, a[ 3] -> Rational[ -1, 6], a[ 4] -> Rational[ 1, 8], a[ 5] -> Rational[ -1, 10], a[ 6] -> Rational[ 4, 45], a[ 7] -> Rational[ -19, 240], a[ 8] -> Rational[ 191, 2688], a[ 9] -> Rational[ -2921, 45360]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We can substitute this value in the expression of y to get the \ series expansion of our solution up to the ninth power of t:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(y1[t_] = y /. ycoeffs1\)], "Input"], Cell[BoxData[ \(TraditionalForm \`\(-\(\(2921\ t\^9\)\/45360\)\) + \(191\ t\^8\)\/2688 - \(19\ t\^7\)\/240 + \(4\ t\^6\)\/45 - t\^5\/10 + t\^4\/8 - t\^3\/6 + 1 \)], "Output"] }, Open ]], Cell["\<\ Now we solve the differential equation with the initial conditions \ y[0]=0, y'[0]=1.This imposes the following condition on the coefficients of \ the series expansion\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({y \[Equal] 0, D[y, t] \[Equal] 1} /. t \[Rule] 0\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{a(0) == 0, a(1) == 1}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((ycoeffs2 = First[Solve[Join[%, eqns], Table[a[i], {i, 0, n}]]])\) // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(a(0) \[Rule] 0\)}, {\(a(1) \[Rule] 1\)}, {\(a(2) \[Rule] \(-\(1\/2\)\)\)}, {\(a(3) \[Rule] 1\/3\)}, {\(a(4) \[Rule] \(-\(1\/3\)\)\)}, {\(a(5) \[Rule] 7\/24\)}, {\(a(6) \[Rule] \(-\(61\/240\)\)\)}, {\(a(7) \[Rule] 569\/2520\)}, {\(a(8) \[Rule] \(-\(73\/360\)\)\)}, {\(a(9) \[Rule] 9527\/51840\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {a[ 0] -> 0, a[ 1] -> 1, a[ 2] -> Rational[ -1, 2], a[ 3] -> Rational[ 1, 3], a[ 4] -> Rational[ -1, 3], a[ 5] -> Rational[ 7, 24], a[ 6] -> Rational[ -61, 240], a[ 7] -> Rational[ 569, 2520], a[ 8] -> Rational[ -73, 360], a[ 9] -> Rational[ 9527, 51840]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{\(y2[t_]\), "=", StyleBox[\(y /. \ ycoeffs2\), FormatType->StandardForm]}]], "Input"], Cell[BoxData[ \(TraditionalForm \`\(9527\ t\^9\)\/51840 - \(73\ t\^8\)\/360 + \(569\ t\^7\)\/2520 - \(61\ t\^6\)\/240 + \(7\ t\^5\)\/24 - t\^4\/3 + t\^3\/3 - t\^2\/2 + t \)], "Output"] }, Open ]], Cell[BoxData[ \(\(seriesSols = Plot[{y1[t], y2[t]}, {t, \(-1\), 1.5}, Frame \[Rule] True, PlotStyle \[Rule] {{Dashing[{ .02, .01}], Hue[ .66]}}]; \)\)], "Input"], Cell[TextData[{ "The solution given by ", StyleBox["Mathematica", FontSlant->"Italic"], " is" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[y]; \n y1e[t_] = y[t] /. First[ DSolve[\ { \[IndentingNewLine]\((t\ + \ 1)\)*\(\(y'\)'\)[t]\ + \ \(y'\)[\ t]\ + \ t\ y[t] \[Equal] 0, \[IndentingNewLine]y[0] \[Equal] 0, \(y'\)[0] \[Equal] 1\[IndentingNewLine]}, y[t], t]]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ \(\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ \((t + 1)\) - 1\/2\ \(log(t + 1)\)\)\), " ", \(\@\(t + 1\)\), " ", RowBox[{"(", RowBox[{ FractionBox[ RowBox[{ \((1\/2 - \[ImaginaryI]\/2)\), " ", \(\[ExponentialE]\^\[ImaginaryI]\), " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\ \((t + 1)\)\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}]}], RowBox[{ RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(3\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["2", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}]}], "+", RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}]}]}]], "-", FractionBox[ RowBox[{ \((1\/2 - \[ImaginaryI]\/2)\), " ", \(\[ExponentialE]\^\[ImaginaryI]\), " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\ \((t + 1)\)\), ")"}]}], RowBox[{ RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(3\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["2", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}]}], "+", RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}]}]}]]}], ")"}]}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[y]; \n y2e[t_] = y[t] /. First[ DSolve[\ { \[IndentingNewLine]\((t\ + \ 1)\)*\(\(y'\)'\)[t]\ + \ \(y'\)[\ t]\ + \ t\ y[t] \[Equal] 0, \[IndentingNewLine]y[0] \[Equal] 1, \(y'\)[0] \[Equal] 0\[IndentingNewLine]}, y[t], t]]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ \(\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ \((t + 1)\) - 1\/2\ \(log(t + 1)\)\)\), " ", \(\@\(t + 1\)\), " ", RowBox[{"(", RowBox[{ FractionBox[ RowBox[{ \((1\/2 + \[ImaginaryI]\/2)\), " ", \(\[ExponentialE]\^\[ImaginaryI]\), " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\ \((t + 1)\)\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{"(", RowBox[{ RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}], "+", RowBox[{\((1 - \[ImaginaryI])\), " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}]}]}], ")"}]}], RowBox[{ RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(3\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["2", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}]}], "+", RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}]}]}]], "-", FractionBox[ RowBox[{ \((1\/2 + \[ImaginaryI]\/2)\), " ", \(\[ExponentialE]\^\[ImaginaryI]\), " ", RowBox[{"(", RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], "-", RowBox[{\((1 - \[ImaginaryI])\), " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(3\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["2", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]]}]}], ")"}], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\ \((t + 1)\)\), ")"}]}], RowBox[{ RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(3\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["2", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(1\/2 - \[ImaginaryI]\/2, 1, 2\ \[ImaginaryI]\), ")"}]}], "+", RowBox[{ TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - \[ImaginaryI]\/2\), (Editable -> True)], ";", TagBox["1", (Editable -> True)], ";", TagBox[\(2\ \[ImaginaryI]\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]], " ", RowBox[{ TagBox["U", HypergeometricU], "(", \(3\/2 - \[ImaginaryI]\/2, 2, 2\ \[ImaginaryI]\), ")"}]}]}]]}], ")"}]}], TraditionalForm]], "Output"] }, Open ]], Cell[BoxData[ \(\(exactSols = Plot[{y1e[t], y2e[t]}, {t, \(-1\), 1.5}, Frame \[Rule] True]; \)\)], "Input"], Cell["\<\ These compares the exact and the approximate solutions. Please note \ that for t<1 one of the exact solutions is not even real.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Show[seriesSols, exactSols]\)], "Input"], Cell[BoxData[ FormBox[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False], TraditionalForm]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["The short way (*)", "Subsubsection"], Cell["\<\ By using Series. To be added in a next release of this \ notebook.\ \>", "Text"] }, Closed]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Frobenius method: regular singular points \ \>", "Section"], Cell[CellGroupData[{ Cell["0. The Indicial Equation", "Subsection"], Cell["\<\ Here's a generical second order equation with variable \ coefficients.\ \>", "Text"], Cell[CellGroupData[{ Cell["eq=y''[x]+p[x]y'[x]+q[x]y[x]==0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(\(q(x)\)\ \(y(x)\)\), "+", RowBox[{\(p(x)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's expand the coefficients p[x] and q[x] into power series (we \ use x0=0 to make things simpler)\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ {qs=Sum[cq[n] x^(n-2),{n,0,Infinity}], ps=Sum[cp[n] x^(n-1),{n,0,Infinity}]}//ColumnForm\ \>", "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\)\ \(cq(n)\)\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 1\)\ \(cp(n)\)\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Summa[ Times[ Power[ x, Plus[ -2, n]], cq[ n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Power[ x, Plus[ -1, n]], cp[ n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We do the same for the function y[x] considering a modified series \ to cope with the eventual singularity\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ys = Sum[a\_n\ x^\((r + n)\), {n, 0, Infinity}]\)], "Input"], Cell[BoxData[ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + r\)\ a\_n\)}], HoldForm], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now we can substitute this tentative solution (along with its \ derivatives) into the original equation, obtaining\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=eq/.{ \tp[x]->ps,q[x]->qs, \ty[x]->ys,y'[x]->SumD[ys,x],y''[x]->SumD[ys,{x,2}] \t}\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r - 1)\)\ \((n + r)\)\ x\^\(n + r - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 1\)\ \(cp(n)\)\)}], HoldForm], "TraditionalForm"], ")"}], " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r)\)\ x\^\(n + r - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\)\ \(cq(n)\)\)}], HoldForm], "TraditionalForm"], ")"}], " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + r\)\ a\_n\)}], HoldForm], "TraditionalForm"]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ This is a rather complicated expression, but let's see what the \ first term looks like. We split the sums at position 1 in order to make the \ term for n=0 explicit. By expanding the result and further simplifying the \ result we get the following:\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumSimplify[SumSplit[eqs,1]//SumExpand//BringIn]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(r\^2\ a\_0\ x\^\(r - 2\)\), "-", \(r\ a\_0\ x\^\(r - 2\)\), "+", \(r\ \(cp(0)\)\ a\_0\ x\^\(r - 2\)\), "+", \(\(cq(0)\)\ a\_0\ x\^\(r - 2\)\), "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\)\ \(cq(n)\)\)}], HoldForm], "TraditionalForm"], ")"}], " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + r\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 1\)\ \(cp(n)\)\)}], HoldForm], "TraditionalForm"], ")"}], " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((n\ a\_n\ x\^\(n + r - 1\) + r\ a\_n\ x\^\(n + r - 1\)) \)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + r - 2\)\ \((r\ \(cp(n)\)\ a\_0 + \(cq(n)\)\ a\_0 + \((n + r)\)\ \((n + r + cp(0) - 1)\)\ a\_n + \(cq(0)\)\ a\_n)\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "A necessary condition for the above equality to be true is that the \ coefficient of ", Cell[BoxData[ \(TraditionalForm\`x\^\(r - 2\)\)]], " be zero. This results in the celebrated ", StyleBox["indicial equation", FontSlant->"Italic"], ", that poses a condition on the value of r to be used in the potential \ solution ", Cell[BoxData[ \(TraditionalForm \`y[x] = x\^r\ Sum[\(a\_k\) x\^k, {k, 1, \[Infinity]}]\)]], " ", Cell[BoxData[ FormBox["", TraditionalForm]]] }], "Text"], Cell[CellGroupData[{ Cell["indicialEq=Coefficient[#,x^(r-2)]& /@ eqs2", "Input"], Cell[BoxData[ \(TraditionalForm \`a\_0\ r\^2 + \(cp(0)\)\ a\_0\ r - a\_0\ r + \(cq(0)\)\ a\_0 == 0\)], "Output"] }, Open ]], Cell["\<\ The indicial equation solutions are functions of the first \ coefficients of the power series expansions of p[x] and q[x]\ \>", "Text"], Cell[CellGroupData[{ Cell["(sol=Solve[indicialEq,r])//ColumnForm", "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { \({r \[Rule] 1\/2\ \(( \(-\(cp(0)\)\) - \@\(\((cp(0) - 1)\)\^2 - 4\ \(cq(0)\)\) + 1)\)}\)}, { \({r \[Rule] 1\/2\ \(( \(-\(cp(0)\)\) + \@\(\((cp(0) - 1)\)\^2 - 4\ \(cq(0)\)\) + 1)\)}\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {{r -> Times[ Rational[ 1, 2], Plus[ 1, Times[ -1, cp[ 0]], Times[ -1, Power[ Plus[ Power[ Plus[ -1, cp[ 0]], 2], Times[ -4, cq[ 0]]], Rational[ 1, 2]]]]]}, {r -> Times[ Rational[ 1, 2], Plus[ 1, Times[ -1, cp[ 0]], Power[ Plus[ Power[ Plus[ -1, cp[ 0]], 2], Times[ -4, cq[ 0]]], Rational[ 1, 2]]]]}}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ The form of the solution depends on whether r1 and r2 are \ distinct, differing by an integer or equal.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["\t1. Distinct solutions \t\t\t(r1-r2 not integer)", "Subsection"], Cell["This differential equation, in a neighborhood of x=0", "Text"], Cell["eq=x y''[x]+(1+x)y'[x]-1/(16x)y[x]==0;", "Input"], Cell["\<\ has an indicial equation with solutioni r=1/4 ed r=-1/4. Since they \ do not differ by an integer, Frobenius method states that we can find two \ linear independent solutions in the form\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(y\_1\)(x) = \(\@x\%4\ \(\[Sum]\+\(n = 0\)\%\[Infinity] a\_n\ x\^n\)\n\t \(\(y\_2\)(x)\) = \(1\/\@x\%4\) \(\[Sum]\+\(n = 0\)\%\[Infinity] b\_n\ x\^n\)\)\)\)], "Text", Evaluatable->False], Cell["\<\ Let's find the first one, for r=1/4\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = x^\((1/4)\) Sum[\(a\_n\) x^n, {n, 0, Infinity}], \t\n\ y1s = SumD[ys, x], \n\ y2s = SumD[y1s, x]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{\(\@x\%4\), " ", FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/4)\)\ x\^\(n - 3\/4\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 3\/4)\)\ \((n + 1\/4)\)\ x\^\(n - 7\/4\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, Rational[ 1, 4]], Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ Rational[ 1, 4], n], Power[ x, Plus[ Rational[ -3, 4], n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ Rational[ -3, 4], n], Plus[ Rational[ 1, 4], n], Power[ x, Plus[ Rational[ -7, 4], n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ The equation has already polynomial coefficients so we don't need \ to expand them in power series. We plug the power series for our tentative \ solution and its derivatives into the original equation to get\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"x", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 3\/4)\)\ \((n + 1\/4)\)\ x\^\(n - 7\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{\((x + 1)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/4)\)\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "-", FractionBox[ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], \(16\ x\^\(3/4\)\)]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs=SumExpand[BringIn[eqs]]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(1\/2\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{\(1\/4\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n + 1\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["We align the exponents to n-3/4", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n-3/4]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/4\ x\^\(n - 3\/4\)\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ x\^\(n - 3\/4\)\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/2\ n\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["We make all the sum start from 1", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,1]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/4\ x\^\(n - 3\/4\)\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ x\^\(n - 3\/4\)\ a\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/2\ n\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["And we squeeze all the sums intoa single one", "Text"], Cell[CellGroupData[{ Cell["res=SumSimplify[eqs2]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/4\ x\^\(n - 3\/4\)\ \((\((4\ n - 3)\)\ a\_\(n - 1\) + 2\ n\ \((2\ n + 1)\)\ a\_n) \)\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Then we solve for coefficents", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sol = \(Solve[SumToTerm[res], a\_n]\)[\([1]\)] // Simplify\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{a\_n \[Rule] \(-\(\(\((4\ n - 3)\)\ a\_\(n - 1\)\)\/\(2\ n\ \((2\ n + 1)\)\)\)\)} \)], "Output"] }, Open ]], Cell["\<\ The second linear independent solution is found in the same way\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = x^\((\(-1\)/4)\) Sum[\(b\_n\) x^n, {n, 0, Infinity}], \t\n\ y1s = SumD[ys, x], \n\ y2s = SumD[y1s, x]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FractionBox[ FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], "TraditionalForm"], \(\@x\%4\)]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1\/4)\)\ x\^\(n - 5\/4\)\ b\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 5\/4)\)\ \((n - 1\/4)\)\ x\^\(n - 9\/4\)\ b\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, Rational[ -1, 4]], Summa[ Times[ Power[ x, n], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ Rational[ -1, 4], n], Power[ x, Plus[ Rational[ -5, 4], n]], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ Rational[ -5, 4], n], Plus[ Rational[ -1, 4], n], Power[ x, Plus[ Rational[ -9, 4], n]], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["We expand and bring inside the coefficients...", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpand[ \tBringIn[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] ]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(-\(1\/2\)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 5\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 5\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"], "-", RowBox[{\(1\/4\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 1\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Add some manipulation...", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n-5/4]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\(1\/4\)\)\ x\^\(n - 5\/4\)\ b\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1)\)\ x\^\(n - 5\/4\)\ b\_\(n - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\(1\/2\)\)\ n\ x\^\(n - 5\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 5\/4\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["res=SumSplit[eqs2,1]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/4\ x\^\(n - 5\/4\)\ \((\((4\ n - 5)\)\ b\_\(n - 1\) + 2\ n\ \((2\ n - 1)\)\ b\_n) \)\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["and solve...", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sol = \(Solve[SumToTerm[res], b\_n]\)[\([1]\)]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_n \[Rule] \(-\(\(\((4\ n - 5)\)\ b\_\(n - 1\)\)\/\(2\ n\ \((2\ n - 1)\)\)\)\)} \)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["\t2. Integer separated solutions \t(r1-r2 integer)", "Subsection"], Cell["In a neighborhood of 0, the equation", "Text"], Cell["eq=y''[x]+(1-2/(3x))y'[x]+(4/(9x^2)+x)y[x]==0;", "Input"], Cell["\<\ has indicial equation with solutions 1/3 and 4/3, hence differing \ by an integer. The Frobenius method states that we must look for solutions in \ the form\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(y\_1\)(x) = \(x\^\(4/3\)\ \(\[Sum]\+\(n = 0\)\%\[Infinity] a\_n\ x\^n\)\n\t \(\(y\_2\)(x)\) = \(x\^\(1/3\)\) \(\[Sum]\+\(n = 0\)\%\[Infinity] b\_n\ x\^n\) + c\ \(\(y\_1\)(x)\)\ \(log(x)\)\)\)\)], "Text", Evaluatable->False], Cell["\<\ The first one, for r=4/3\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {ys = x^\((4/3)\) Sum[\(a\_n\) x^n, {n, 0, Infinity}], \t\n\ y1s = SumD[ys, x], \n\ y2s = SumD[y1s, x]} // ColumnForm\)\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{\(x\^\(4/3\)\), " ", FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 4\/3)\)\ x\^\(n + 1\/3\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ \((n + 4\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, Rational[ 4, 3]], Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ Rational[ 4, 3], n], Power[ x, Plus[ Rational[ 1, 3], n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ Rational[ 1, 3], n], Plus[ Rational[ 4, 3], n], Power[ x, Plus[ Rational[ -2, 3], n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["Yields", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpandAll[ \tBringIn[\t\t \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] \t]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\/3\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 7\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ (Note that we used ExpandAllSum : with ExpandSum only we would have \ needed a further expansion to get the same result). Now we can align all the \ exponents to n+7/3\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n+7/3]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 7\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\/3\ x\^\(n + 7\/3\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\ x\^\(n + 7\/3\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-3\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 3)\)\ x\^\(n + 7\/3\)\ a\_\(n + 3\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-3\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 3)\)\^2\ x\^\(n + 7\/3\)\ a\_\(n + 3\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Breaking in 0 brings us to", "Text"], Cell[CellGroupData[{ Cell["res=SumSplit[eqs2,0]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(7\/3\ a\_1\ x\^\(4/3\)\), "+", \(6\ a\_2\ x\^\(4/3\)\), "+", \(4\/3\ a\_0\ \@x\%3\), "+", \(2\ a\_1\ \@x\%3\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/3\ x\^\(n + 7\/3\)\ \((3\ a\_n + \((3\ n + 10)\)\ a\_\(n + 2\) + 3\ \((n\^2 + 7\ n + 12)\)\ a\_\(n + 3\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ As usual we solve for coefficients. Note that we use GetCoefficient \ to extract the coefficient of x^(n+7/3) from the sum. And we consider \ res[[1]] to get the rhs of res.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ {eq1=Coefficient[res[[1]],x^(1/3)]==0, eq2=Coefficient[res[[1]],x^(4/3)]==0, eqn=SumCoefficient[res[[1]],x^(n+7/3)]==0}//ColumnForm\ \>", "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(\(4\ a\_0\)\/3 + 2\ a\_1 == 0\)}, {\(\(7\ a\_1\)\/3 + 6\ a\_2 == 0\)}, { \(1\/3\ \(( 3\ a\_n + \((3\ n + 10)\)\ a\_\(n + 2\) + 3\ \((n\^2 + 7\ n + 12)\)\ a\_\(n + 3\))\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ Times[ Rational[ 4, 3], Subscript[ a, 0]], Times[ 2, Subscript[ a, 1]]], 0], Equal[ Plus[ Times[ Rational[ 7, 3], Subscript[ a, 1]], Times[ 6, Subscript[ a, 2]]], 0], Equal[ Times[ Rational[ 1, 3], Plus[ Times[ 3, Subscript[ a, n]], Times[ Plus[ 10, Times[ 3, n]], Subscript[ a, Plus[ 2, n]]], Times[ 3, Plus[ 12, Times[ 7, n], Power[ n, 2]], Subscript[ a, Plus[ 3, n]]]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(\(4\ a\_0\)\/3 + 2\ a\_1 == 0\)}, {\(\(7\ a\_1\)\/3 + 6\ a\_2 == 0\)}, { \(a\_\(n + 3\)\ n\^2 + a\_\(n + 2\)\ n + 7\ a\_\(n + 3\)\ n + a\_n + \(10\ a\_\(n + 2\)\)\/3 + 12\ a\_\(n + 3\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ Times[ Rational[ 4, 3], Subscript[ a, 0]], Times[ 2, Subscript[ a, 1]]], 0], Equal[ Plus[ Times[ Rational[ 7, 3], Subscript[ a, 1]], Times[ 6, Subscript[ a, 2]]], 0], Equal[ Plus[ Subscript[ a, n], Times[ Rational[ 10, 3], Subscript[ a, Plus[ 2, n]]], Times[ n, Subscript[ a, Plus[ 2, n]]], Times[ 12, Subscript[ a, Plus[ 3, n]]], Times[ 7, n, Subscript[ a, Plus[ 3, n]]], Times[ Power[ n, 2], Subscript[ a, Plus[ 3, n]]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(sol = \(Solve[{eq1, eq2, eqn}, {a\_\(n + 3\), a\_2, a\_1}]\)[\([1]\)]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{a\_2 \[Rule] \(7\ a\_0\)\/27, a\_\(n + 3\) \[Rule] \(-\(\(a\_n + 1\/3\ \((3\ n + 10)\)\ a\_\(n + 2\)\)\/\(n\^2 + 7\ n + 12\)\)\), a\_1 \[Rule] \(-\(\(2\ a\_0\)\/3\)\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{a\_2 \[Rule] \(7\ a\_0\)\/27, a\_\(n + 3\) \[Rule] \(-\(\(a\_n + n\ a\_\(n + 2\) + \(10\ a\_\(n + 2\)\)\/3\)\/\(n\^2 + 7\ n + 12\)\)\), a\_1 \[Rule] \(-\(\(2\ a\_0\)\/3\)\)}\)], "Output"] }, Open ]], Cell["\<\ The second linear indepent solution may contain a Log term\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(y\_2\)(x) = \(\@x\%3\) \(\[Sum]\+\(n = 0\)\%\[Infinity] b\_n\ x\^n\) + k\ \(\(y\_1\)(x)\)\ log\ \((x)\)\)\)], "Text"], Cell["\<\ We can use a brute force approach to insert this solution and its \ derivatives into the equation. Care must be used to avoid cumbersome \ expressions\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ys = k\ Log[x] x^\((4/3)\) Sum[\(a\_n\) x^n, {n, 0, Infinity}] + \n\ \ \ \ x^\((1/3)\) Sum[\(b\_n\) x^n, {n, 0, Infinity}]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"k", " ", \(log(x)\), " ", RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(x\^\(4/3\)\)}], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(\@x\%3\)}]}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["y1s=SumD[ys,x]//BringOut", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 4\/3)\)\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["y2s=SumD[y1s,x]//BringOut", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(4\/3\), " ", "k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{\(4\/3\), " ", "k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ \((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 2\/3)\)\ \((n + 1\/3)\)\ x\^\(n - 5\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["Here's the equation. Not a very beautiful sight...", "Text"], Cell[CellGroupData[{ Cell["eqs=eq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}//BringOut", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(4\/3\), " ", "k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{\(4\/3\), " ", "k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ \((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 2\/3)\)\ \((n + 1\/3)\)\ x\^\(n - 5\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{\((1 - 2\/\(3\ x\))\), " ", RowBox[{"(", RowBox[{ RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \(log(x)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 4\/3)\)\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], ")"}]}], "+", RowBox[{\((x + 4\/\(9\ x\^2\))\), " ", RowBox[{"(", RowBox[{ RowBox[{"k", " ", \(log(x)\), " ", RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(x\^\(4/3\)\)}], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(\@x\%3\)}]}], ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ The k Log[x] is quite annoying. Let's see if there is a way to get \ rid of it\ \>", "Text"], Cell[CellGroupData[{ Cell["Collect[eqs[[1]], Log[x]]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(4\/3\), " ", "k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \((1 - 2\/\(3\ x\))\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{\(log(x)\), " ", RowBox[{"(", RowBox[{ RowBox[{"k", " ", \((x + 4\/\(9\ x\^2\))\), " ", RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(x\^\(4/3\)\)}], "+", RowBox[{\(4\/3\), " ", "k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ \((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", \((1 - 2\/\(3\ x\))\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 4\/3)\)\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}]}], ")"}]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 2\/3)\)\ \((n + 1\/3)\)\ x\^\(n - 5\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{\((1 - 2\/\(3\ x\))\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{\(\@x\%3\), " ", \((x + 4\/\(9\ x\^2\))\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"]}]}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[ "by inspection we can see that one of the terms is in the form k Log[x]*(eq \ /. y[x]\[Rule]y1). Since y1 is a solution of the equation, this is equivalent \ to k Log[x]*(0)=0. Hence our equation is:"], "Text"], Cell[CellGroupData[{ Cell["eqs=eqs/.Log[x] _->0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(4\/3\), " ", "k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 2\/3)\)\ \((n + 1\/3)\)\ x\^\(n - 5\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{\((1 - 2\/\(3\ x\))\), " ", RowBox[{"(", RowBox[{ RowBox[{"k", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1\/3)\)\ x\^\(n - 2\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], ")"}]}], "+", RowBox[{\(\@x\%3\), " ", \((x + 4\/\(9\ x\^2\))\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["We now proceed as in the usual case", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExpand[eqs]//BringIn", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\(2\/3\)\)\ k\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\/3\ k\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ n\ x\^\(n - 2\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(n + 1\/3\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((1\/3\ k\ a\_n\ x\^\(n - 2\/3\) + k\ n\ a\_n\ x\^\(n - 2\/3\))\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\/9\ x\^\(n - 5\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 4\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((\(-\(2\/3\)\)\ n\ b\_n\ x\^\(n - 5\/3\) - 2\/9\ b\_n\ x\^\(n - 5\/3\))\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((n\^2\ b\_n\ x\^\(n - 5\/3\) - 1\/3\ n\ b\_n\ x\^\(n - 5\/3\) - 2\/9\ b\_n\ x\^\(n - 5\/3\))\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((n\ b\_n\ x\^\(n - 2\/3\) + 1\/3\ b\_n\ x\^\(n - 2\/3\)) \)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs2,x,n->n+4/3]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-1\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(n + 4\/3\)\ a\_\(n + 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(n + 4\/3\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(2\ k\ \((n + 2)\)\ x\^\(n + 4\/3\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 4\/3\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/3\ x\^\(n + 4\/3\)\ b\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\ x\^\(n + 4\/3\)\ b\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-3\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n + 3)\)\)\ x\^\(n + 4\/3\)\ b\_\(n + 3\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-3\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 3)\)\^2\ x\^\(n + 4\/3\)\ b\_\(n + 3\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["res=SumSplit[eqs2,0]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(k\ \@x\%3\ a\_0\), "+", \(\(k\ a\_0\)\/x\^\(2/3\)\), "+", \(3\ k\ \@x\%3\ a\_1\), "+", \(b\_0\/\(3\ x\^\(2/3\)\)\), "+", \(4\/3\ \@x\%3\ b\_1\), "+", \(2\ \@x\%3\ b\_2\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/3\ x\^\(n + 4\/3\)\ \((3\ b\_\(n + 3\)\ \((n + 3)\)\^2 - 3\ b\_\(n + 3\)\ \((n + 3)\) + 3\ k\ a\_\(n + 1\) + 3\ k\ \((2\ n + 5)\)\ a\_\(n + 2\) + 3\ b\_n + 3\ n\ b\_\(n + 2\) + 7\ b\_\(n + 2\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Then we solve for the coefficients", "Text"], Cell[CellGroupData[{ Cell["\<\ {eq1=Coefficient[res[[1]],x^(-2/3)]==0, eq2=Coefficient[res[[1]],x^(1/3)]==0, eqn=SumCoefficient[res[[1]],x^(n+4/3)]==0}//ColumnForm\ \>", "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(k\ a\_0 + b\_0\/3 == 0\)}, {\(k\ a\_0 + 3\ k\ a\_1 + \(4\ b\_1\)\/3 + 2\ b\_2 == 0\)}, { \(1\/3\ \(( 3\ b\_\(n + 3\)\ \((n + 3)\)\^2 - 3\ b\_\(n + 3\)\ \((n + 3)\) + 3\ k\ a\_\(n + 1\) + 3\ k\ \((2\ n + 5)\)\ a\_\(n + 2\) + 3\ b\_n + 3\ n\ b\_\(n + 2\) + 7\ b\_\(n + 2\))\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ Times[ k, Subscript[ a, 0]], Times[ Rational[ 1, 3], Subscript[ b, 0]]], 0], Equal[ Plus[ Times[ k, Subscript[ a, 0]], Times[ 3, k, Subscript[ a, 1]], Times[ Rational[ 4, 3], Subscript[ b, 1]], Times[ 2, Subscript[ b, 2]]], 0], Equal[ Times[ Rational[ 1, 3], Plus[ Times[ 3, k, Subscript[ a, Plus[ 1, n]]], Times[ 3, k, Plus[ 5, Times[ 2, n]], Subscript[ a, Plus[ 2, n]]], Times[ 3, Subscript[ b, n]], Times[ 7, Subscript[ b, Plus[ 2, n]]], Times[ 3, n, Subscript[ b, Plus[ 2, n]]], Times[ -3, Plus[ 3, n], Subscript[ b, Plus[ 3, n]]], Times[ 3, Power[ Plus[ 3, n], 2], Subscript[ b, Plus[ 3, n]]]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(k\ a\_0 + b\_0\/3 == 0\)}, {\(k\ a\_0 + 3\ k\ a\_1 + \(4\ b\_1\)\/3 + 2\ b\_2 == 0\)}, { \(b\_\(n + 3\)\ n\^2 + 2\ k\ a\_\(n + 2\)\ n + b\_\(n + 2\)\ n + 5\ b\_\(n + 3\)\ n + k\ a\_\(n + 1\) + 5\ k\ a\_\(n + 2\) + b\_n + \(7\ b\_\(n + 2\)\)\/3 + 6\ b\_\(n + 3\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ Times[ k, Subscript[ a, 0]], Times[ Rational[ 1, 3], Subscript[ b, 0]]], 0], Equal[ Plus[ Times[ k, Subscript[ a, 0]], Times[ 3, k, Subscript[ a, 1]], Times[ Rational[ 4, 3], Subscript[ b, 1]], Times[ 2, Subscript[ b, 2]]], 0], Equal[ Plus[ Times[ k, Subscript[ a, Plus[ 1, n]]], Times[ 5, k, Subscript[ a, Plus[ 2, n]]], Times[ 2, k, n, Subscript[ a, Plus[ 2, n]]], Subscript[ b, n], Times[ Rational[ 7, 3], Subscript[ b, Plus[ 2, n]]], Times[ n, Subscript[ b, Plus[ 2, n]]], Times[ 6, Subscript[ b, Plus[ 3, n]]], Times[ 5, n, Subscript[ b, Plus[ 3, n]]], Times[ Power[ n, 2], Subscript[ b, Plus[ 3, n]]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ sol = \(Solve[{eq1, eq2, eqn}, {b\_0, b\_2, b\_\(n + 3\)}]\)[\([1]\)]\)\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_0 \[Rule] \(-3\)\ k\ a\_0, b\_2 \[Rule] 1\/2\ \((\(-k\)\ a\_0 - 3\ k\ a\_1 - \(4\ b\_1\)\/3)\), b\_\(n + 3\) \[Rule] \(\(-k\)\ a\_\(n + 1\) - k\ \((2\ n + 5)\)\ a\_\(n + 2\) - b\_n - n\ b\_\(n + 2\) - \(7\ b\_\(n + 2\)\)\/3\)\/\(\((n + 3)\)\^2 - n - 3\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_0 \[Rule] \(-3\)\ k\ a\_0, b\_2 \[Rule] 1\/6\ \((\(-3\)\ k\ a\_0 - 9\ k\ a\_1 - 4\ b\_1)\), b\_\(n + 3\) \[Rule] \(-\(\(k\ a\_\(n + 1\) + 5\ k\ a\_\(n + 2\) + 2\ k\ n\ a\_\(n + 2\) + b\_n + n\ b\_\(n + 2\) + \(7\ b\_\(n + 2\)\)\/3\)\/\(n\^2 + 5\ n + 6\)\)\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["sol/.k->0//Simplify", "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_0 \[Rule] 0, b\_2 \[Rule] \(-\(\(2\ b\_1\)\/3\)\), b\_\(n + 3\) \[Rule] \(-\(\(3\ b\_n + \((3\ n + 7)\)\ b\_\(n + 2\)\)\/\(3\ \((n\^2 + 5\ n + 6)\)\)\)\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_0 \[Rule] 0, b\_2 \[Rule] \(-\(\(2\ b\_1\)\/3\)\), b\_\(n + 3\) \[Rule] \(-\(\(b\_n + 1\/3\ \((3\ n + 7)\)\ b\_\(n + 2\)\)\/\(n\^2 + 5\ n + 6 \)\)\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["sol/.k->1//FullSimplify", "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_0 \[Rule] \(-3\)\ a\_0, b\_2 \[Rule] 1\/6\ \((\(-3\)\ a\_0 - 9\ a\_1 - 4\ b\_1)\), b\_\(n + 3\) \[Rule] \(-\(\(3\ \((a\_\(n + 1\) + \((2\ n + 5)\)\ a\_\(n + 2\) + b\_n)\) + \((3\ n + 7)\)\ b\_\(n + 2\)\)\/\(3\ \((n + 2)\)\ \((n + 3)\)\)\)\)}\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["\t3. Identical solutions \t\t(r1-r2=0) (*)", "Subsection"], Cell["Finally, for", "Text"], Cell["eq=x y''[x]+(2-x)y'[x]+1/(4x)y[x];", "Input"], Cell["we have r=-1/2 and r=0. The solutions are", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(y\_1\)(x) = \(\(1\/\@x\) \(\[Sum]\+\(n = 0\)\%\[Infinity]\(\( a(\ n)\)\ x\^n\)\n\t \(\(y\_2\)(x)\)\) = \[Sum]\+\(n = 0\)\%\[Infinity] b\ \((n)\)\ x\^n + \(\(y\_1\)(x)\)\ \(log(x)\)\)\)\)], "Text", Evaluatable->False], Cell["\<\ The first one is easy\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ {ys=(x^(-1/2)Sum[a[n]x^n,{n,0,Infinity}]),\t y1s=SumD[ys,x], y2s=SumD[y1s,x]}//ColumnForm\ \>", "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FractionBox[ FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ \(a(n)\)\)}], "TraditionalForm"], \(\@x\)]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 1\/2)\)\ x\^\(n - 3\/2\)\ \(a(n)\)\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 3\/2)\)\ \((n - 1\/2)\)\ x\^\(n - 5\/2\)\ \(a(n)\)\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, Rational[ -1, 2]], Summa[ Times[ Power[ x, n], a[ n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ Rational[ -1, 2], n], Power[ x, Plus[ Rational[ -3, 2], n]], a[ n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ Rational[ -3, 2], n], Plus[ Rational[ -1, 2], n], Power[ x, Plus[ Rational[ -5, 2], n]], a[ n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ we expand with respect to p and q and bring everything inside a \ single sum\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpand[ \tBringIn[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] ]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/2\)\ \(a(n)\)\)}], HoldForm], "TraditionalForm"], "+", RowBox[{\(1\/2\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - 1\/2\)\ \(a(n)\)\)}], HoldForm], "TraditionalForm"]}], "-", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 1\/2\)\ \(a(n)\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell["Further manipulation brings to", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n-3/2]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/2\ x\^\(n - 3\/2\)\ \(a(n - 1)\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n - 1)\)\)\ x\^\(n - 3\/2\)\ \(a(n - 1)\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/2\)\ \(a(n)\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,1]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/2\ x\^\(n - 3\/2\)\ \(a(n - 1)\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((n - 1)\)\)\ x\^\(n - 3\/2\)\ \(a(n - 1)\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 3\/2\)\ \(a(n)\)\)}], HoldForm], "TraditionalForm"]}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["res=SumSimplify[eqs2]", "Input"], Cell[BoxData[ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(1\/2\ x\^\(n - 3\/2\)\ \((2\ \(a(n)\)\ n\^2 + \((3 - 2\ n)\)\ \(a(n - 1)\))\)\)}], HoldForm], TraditionalForm]], "Output"] }, Open ]], Cell["and solving", "Text"], Cell[CellGroupData[{ Cell["sol=Solve[GetCoefficient[res,x^(n-3/2)]==0,a[n]][[1]]", "Input"], Cell[BoxData[ \(TraditionalForm \`{a(n) \[Rule] \(-\(\(\((3 - 2\ n)\)\ \(a(n - 1)\)\)\/\(2\ n\^2\)\)\)} \)], "Output"] }, Open ]], Cell["\<\ The second independent solution is less easily found, but can be obtained in \ the same way as in case 2. As is customary, being this a somewhat tedious \ task, let's say that it is left as an exercise.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Hypergeometric Equation (*)", "Subsection"], Cell["\<\ This is Gauss' hypergeometric equation. Needless to say, its \ solutions include the celebrated hypergeometric functions.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(gaussEq = \ x \((1 - x)\) \(\(y'\)'\)[x] + \((c - \((a + b + 1)\) x)\) \(y'\)[x] - a\ b\ y[x] \[Equal] 0\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(\(-a\)\ b\ \(y(x)\)\), "+", RowBox[{\((c - \((a + b + 1)\)\ x)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{\((1 - x)\), " ", "x", " ", RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ In order to solve it with the Frobenius method, we need to find \ what values of r the tentative power series solution\ \>", "Text"], Cell[BoxData[ \(\(ys = x^r\ Sum[\(a\_n\) x^n, {n, 0, \[Infinity]}]; \)\)], "Input"], Cell["\<\ can satisfy the equation. We can find it out by substituting ys and \ its derivative into the equations and by imposing that the coefficient with \ the lowest power of x be zero.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = \(gaussEq /. {y[x] \[Rule] ys, \(y'\)[x] \[Rule] SumD[ys, x], \(\(y'\)'\)[x] \[Rule] SumD[ys, {x, 2}]} // SumExpandAll\) // SumFullSimplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-x\^\(n + r - 1\)\)\ \((\((a + n + r)\)\ \((b + n + r)\)\ x - \((n + r)\)\ \((c + n + r - 1)\))\)\ a\_n\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SumSplit[eqs, 1] /. Sum[_, _] \[Rule] 0\)], "Input"], Cell[BoxData[ \(TraditionalForm \`\(-x\^\(r - 1\)\)\ \((\((a + r)\)\ \((b + r)\)\ x - r\ \((c + r - 1)\))\)\ a\_0 == 0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(Collect[#\ , x]&\)\ /@%\)], "Input"], Cell[BoxData[ \(TraditionalForm \`r\ \((c + r - 1)\)\ x\^\(r - 1\)\ a\_0 - \((a + r)\)\ \((b + r)\)\ x\^r\ a\_0 == 0\)], "Output"] }, Open ]], Cell[TextData[{ "The smallest power is ", Cell[BoxData[ \(TraditionalForm\`x\^\(r - 1\)\)]], ". By equating its coefficient to zero we get the indicial equation, whose \ solutions are ", Cell[BoxData[ \(TraditionalForm\`r = 0\)]], " and ", Cell[BoxData[ \(TraditionalForm\`r = 1 - c\)]], ". We can now try to find a power series solution in either one of the two \ forms" }], "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \[Sum]\+\(n = 0\)\%\[Infinity] a\_n\ x\^n\n\tx\^\(1 - c\)\ \(\[Sum]\+\(n = 0\)\%\[Infinity] a\_n\ x\^n\)\)\)], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Euler-Cauchy Equation", "Subsection"], Cell[TextData[{ "A little '", StyleBox["amarcord", FontSlant->"Italic"], "'. Here we solve the Cauchy-Euler equation by enabling Sum evaluation and \ using old naming conventions for the procedures defined in Summa.m. We will \ then work with Summa objects directl as it was done with version 1.x of the \ Summa.m package." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(EnableSumEvaluation[]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`"From now on Sums will be evaluated directly by Mathematica, while \ Summa objects for symbolic endpoints will not evaluate."\)], "Print"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Clear[y,x,a]; cauchyEq=x^2 y''[x]-2x y'[x]-10y[x]==0\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", \(x\^2\)}], "-", RowBox[{"2", " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", "x"}], "-", \(10\ \(y(x)\)\)}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "We can get the indicial equation directly by manipulating the equation to \ be solved. We look for a solution in the form of a power series about the \ point ", Cell[BoxData[ \(TraditionalForm\`x\_0 = 0\)]], ". We do not know whether such a solution exists or not, since the theorem \ of existence is not applicable." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {ys = x^r\ Summa[\(a\_n\) x^n, {n, 0, Infinity}], \n\ y1s = DSum[ys, x], \n\ y2s = DSum[y1s, x]} // ColumnForm\)\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{\(x\^r\), " ", FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r)\)\ x\^\(n + r - 1\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r - 1)\)\ \((n + r)\)\ x\^\(n + r - 2\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, r], Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ n, r], Power[ x, Plus[ -1, n, r]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ -1, n, r], Plus[ n, r], Power[ x, Plus[ -2, n, r]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ with r that needs to be determined. Substitution into the equation \ yields\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=cauchyEq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(-10\), " ", RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(x\^r\)}], "+", RowBox[{ RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r - 1)\)\ \((n + r)\)\ x\^\(n + r - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", \(x\^2\)}], "-", RowBox[{"2", " ", RowBox[{"(", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + r)\)\ x\^\(n + r - 1\)\ a\_n\)}], HoldForm], "TraditionalForm"], ")"}], " ", "x"}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now we begin the usual manipulation of sums in order to reach a \ form with a single sum, plus some extra terms. We start by clumping all the \ Sums together\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs=SimplifySum[eqs]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n\^2 + \((2\ r - 3)\)\ n + r\^2 - 3\ r - 10)\)\ x\^\(n + r\)\ a\_n\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "the first element is in the form ", Cell[BoxData[ \(TraditionalForm\`c\ x\^r\)]], ", as we can see by expliciting every term with index n<1. " }], "Text"], Cell[CellGroupData[{ Cell["eqs2=BreakSum[eqs,1]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(\((r\^2 - 3\ r - 10)\)\ a\_0\ x\^r\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n\^2 + \((2\ r - 3)\)\ n + r\^2 - 3\ r - 10)\)\ x\^\(n + r\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ hence, for the identity principle, we need r to satisfy the \ following indicial equation\ \>", "Text"], Cell[CellGroupData[{ Cell["indicialEq=Coefficient[#,x^r]& /@ eqs2", "Input"], Cell[BoxData[ \(TraditionalForm\`\((r\^2 - 3\ r - 10)\)\ a\_0 == 0\)], "Output"] }, Open ]], Cell["whose solutions are easily found:", "Text"], Cell[CellGroupData[{ Cell["Solve[indicialEq,r]", "Input"], Cell[BoxData[ \(TraditionalForm\`{{r \[Rule] \(-2\)}, {r \[Rule] 5}}\)], "Output"] }, Open ]], Cell[TextData[{ "\n\nSolving for ", Cell[BoxData[ \(TraditionalForm\`r = \(-2\)\)]] }], "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=ExpandSum[BringIn[ \tcauchyEq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}/.r->-2] ]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "-", RowBox[{"7", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["SimplifySum[eqs]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 7)\)\ n\ x\^\(n - 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "One obvious solution is y(x)=0, corresponding to a series with the general \ term ", Cell[BoxData[ \(TraditionalForm\`a\_n = 0\)]], ". A non trivial solution can be found when n=0 and n=7 regardless of the \ values of ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], ". We can then find a particular solution by specifying two non zero values \ for the coefficients ", Cell[BoxData[ \(TraditionalForm\`a\_0\ and\ a\_7\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ y1[x_] = a\_0\ x^\((0 - 2)\) + \(a\_7\) x^\((7 - 2)\)\)\)], "Input"], Cell[BoxData[ \(TraditionalForm\`a\_7\ x\^5 + a\_0\/x\^2\)], "Output"] }, Open ]], Cell["Let's find a second solution by", "Text"], Cell[CellGroupData[{ Cell["\<\ y2[x_]=y1[x]Integrate[ \t\tExp[-Integrate[-2/x,x]] \t\t\t\t\t/y1[x]^2,x]//Simplify\ \>", "Input"], Cell[BoxData[ \(TraditionalForm\`\(-\(1\/\(7\ x\^2\ a\_7\)\)\)\)], "Output"] }, Open ]], Cell["Hence our general solution has no logarithm and is", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Collect[c1\ y1[x] + c2\ y2[x], x]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`c1\ a\_7\ x\^5 + \(c1\ a\_0 - c2\/\(7\ a\_7\)\)\/x\^2\)], "Output"] }, Open ]], Cell["Let's simplify things a bit, by renaming the constants", "Text"], Cell[CellGroupData[{ Cell["yg[x_]=C[1] x^5+C[2] x^(-2)", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ SubscriptBox[ TagBox["c", C], "1"], " ", \(x\^5\)}], "+", FractionBox[ SubscriptBox[ TagBox["c", C], "2"], \(x\^2\)]}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "We can verify that this is indeed the general solution given by ", StyleBox["Mathematica", FontSlant->"Italic"], ". Note that, being the built-in Sum evaluation process already restored, \ there is no need to wrap EnableSumEvaluation around DSolve." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[x^2\ \(\(y'\)'\)[x] - 2 x\ \(y'\)[x] - 10 y[x] \[Equal] 0, y[x], x]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{"{", RowBox[{\(y(x)\), "\[Rule]", RowBox[{ RowBox[{ SubscriptBox[ TagBox["c", C], "1"], " ", \(x\^5\)}], "+", FractionBox[ SubscriptBox[ TagBox["c", C], "2"], \(x\^2\)]}]}], "}"}], "}"}], TraditionalForm]], "Output"] }, Open ]] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Other examples: Special Functions \ \>", "Section"], Cell[CellGroupData[{ Cell["\<\ Introduction to Sturm Liouville problems and special functions \ (*)\ \>", "Subsubsection"], Cell[TextData[ "Many functions of mathematical and physical interest are solution of a \ particular class of differential equations subjected to specific conditions. \ The following second order differential equation is the starting point for \ many such systems. In the following \[Alpha](x), \[Beta](x) and \[Gamma](x) \ are real functions of the real variable x."], "Text"], Cell[BoxData[ FormBox[ StyleBox[ RowBox[{ RowBox[{ RowBox[{\(\[Alpha](x)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{\(\[Beta](x)\), " ", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", " ", \(\(\[Gamma](x)\) \(y(x)\)\)}], "=", \(\[Lambda]\ \(y(x)\)\)}], FontWeight->"Bold"], TraditionalForm]], "Text", CellFrame->True, TextAlignment->Center, Background->GrayLevel[0.833326]], Cell[TextData[ "This equations is better seen as an eigenvalue problem. We introduce a \ differential operator \[DoubleStruckCapitalL] that, when applied to y(x) \ produce the left hand side of the above equation"], "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \([\(\[Alpha](x)\)\ \[DifferentialD]\^2\/\[DifferentialD]x\^2 + \(\[Beta](x)\)\ \[DifferentialD]\/\[DifferentialD]x + \ \[Gamma](x)]\) \(y(x)\) = \[Lambda]\ \(y(x)\)\)\)], "Text"], Cell["To reach a more compact representation", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t\[DoubleStruckCapitalL]\ y\ = \[Lambda]\ y\)\)], "Text"], Cell[TextData[ "The differential operator \[DoubleStruckCapitalL] is an hermitian operator \ if"], "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \[LeftAngleBracket]\[DoubleStruckCapitalL]\ \[Phi], \[Psi]\[RightAngleBracket]\_w = \[LeftAngleBracket]\[Phi], \(\[DoubleStruckCapitalL]\&_\) \[Psi]\[RightAngleBracket]\_w\)\)], "Text"], Cell[TextData[ "for every pair of functions \[Phi] and \[Psi]. It can be shown (see for \ example Byron and Fuller) that this is the case in every Hilbert space with \ an inner product whose weigth function w(x) satisfies"], "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{ \(\(\[DifferentialD]\/\[DifferentialD]x\)[ \(w(x)\)\ \(\[Alpha](x)\)] = \(w(x)\)\ \(\[Alpha](x)\)\), "\n", FormBox[\(\t Lim\+\(x \[Rule] a\)\[ThinSpace]\([ \(\( w(x)\)\ \(\[Alpha](x)\)\ \((\(\[Phi](x)\)\&_\ \[Psi]' \((x)\) - \(\[Phi]' \((x)\)\)\&_\ \(\[Psi](x)\))\)\) ]\) = Lim\+\(x \[Rule] b\)\[ThinSpace]\([ \(\( w(x)\)\ \(\[Alpha](x)\)\ \((\(\[Phi](x)\)\&_\ \[Psi]' \((x)\) - \(\[Phi]' \((x)\)\)\&_\ \(\[Psi](x)\))\)\) ]\)\), "TraditionalForm"]}]}], TraditionalForm]], "Text"], Cell[TextData[{ "for every pair of functions \[Phi] and \[Psi] in the Hilbert space. (Here \ the overbar stands for complex conjugation, while a and b are the endpoints \ of the interval over which the functions are defined). The eigenvalue problem \ admits then real eigenvalues and the solutions form an orthonormal basis \ spanning the Hilbert space charaterized by the weigth function w(x) in its \ inner product ", " ", Cell[BoxData[ \(TraditionalForm \`\[LeftAngleBracket]\[CenterDot]\(, \[CenterDot]\)\[RightAngleBracket]\_w\)]], "." }], "Text"], Cell["\<\ To make explicit the role of the weigth function w(x) in the \ determination of the solution of the eigenvalue problem, we can recast the \ problem in the following form: \ \>", "Text"], Cell[BoxData[ FormBox[ StyleBox[ \(\(\[DifferentialD]\/\[DifferentialD]x\)[ \(w(x)\) \(\[Alpha](x)\)\ \[DifferentialD]\(y(x)\)\/\[DifferentialD]x] + \((\[Gamma](x) - \[Lambda])\) \(w(x)\)\ \(y(x)\) = 0\), FontWeight->"Bold"], TraditionalForm]], "Text", CellFrame->True, TextAlignment->Center, Background->GrayLevel[0.833326]], Cell["\<\ This is a slightly more compact form, often found in \ textbooks:\ \>", "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(\[DifferentialD]\/\[DifferentialD]x\)[ \(p(x)\) \[DifferentialD]\(y(x)\)\/\[DifferentialD]x] + \(q(x)\)\ \(y(x)\) = \[Lambda]\ \(w(x)\)\ \(y(x)\)\)\)], "Text", TextAlignment->Left], Cell[TextData[ "The above equation is named after Sturm and Liouville and, along with the \ specified boundary conditions (which allow the selection of the orthogonal \ solutions only), constitute a Sturm-Lioville problem. A great deal of special \ functions used in mathematical physics can be derived by this kind of problem \ with specific instances of the coefficients \[Alpha](x), \[Beta](x) and \ \[Gamma](x) and of the weigth function w(x). "], "Text"], Cell["\<\ If we limit ourselves to the search for polynomial solutions to the \ Sturm-Liouville problem, the following exhausts the alternatives\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{GridBox[{ { StyleBox["Interval", FontWeight->"Bold"], StyleBox["Polynomial", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], StyleBox[\(w(x)\), FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], StyleBox[\(Differential\ Equation\), FontWeight->"Bold"]}, {" ", " ", " ", " ", " ", " "}, {\([0, 1]\), StyleBox["Jacobi", FontWeight->"Bold"], " ", \(\(\(x\^p\)(1 - x)\)\^q\), " ", \(\(x(1 - x)\) \(y'\)' - \((\((p + q + 2)\) x + p + 1)\)\ y' + \(n(n + p + q + 1)\) y = 0\)}, {\([\(-1\), 1]\), StyleBox["Jacobi", FontWeight->"Bold"], " ", \(\(\((1 + x)\)\^p\) \((1 - x)\)\^q\), " ", \(\((1 - x\^2)\) \(y'\)' - \((\((p + q + 2)\) x + q - p)\)\ y' + \(n(n + p + q + 1)\) y = 0\)}, {" ", StyleBox[" ", FontWeight->"Bold"], StyleBox["Gegenbauer", FontWeight->"Bold"], \(\((1 - x\^2)\)\^p\), " ", \(\((1 - x\^2)\) \(y'\)' - 2 \((p + 1)\) x\ y' + \(n(n + 2 p + 1)\) y = 0\)}, {" ", StyleBox[" ", FontWeight->"Bold"], StyleBox["Chebychev", FontWeight->"Bold"], \(\((1 - x\^2)\)\^\(\(-1\)/2\)\), " ", \(\((1 - x\^2)\) \(y'\)' - x\ y' + \(n\^2\) y = 0\)}, {" ", StyleBox[" ", FontWeight->"Bold"], StyleBox["Legendre", FontWeight->"Bold"], "1", " ", \(\((1 - x\^2)\) \(y'\)' - 2 x\ y' + \(n(n + 1)\) y = 0\)}, {\(\([0, \[Infinity]\) )\), StyleBox["Laguerre", FontWeight->"Bold"], " ", \(\(x\^p\) \[ExponentialE]\^\(-x\)\), " ", \(x\ \(y'\)' - \((x - \((p + 1)\))\) y' + n\ y = 0\)}, {\((\(-\[Infinity]\), \[Infinity])\), StyleBox["Hermite", FontWeight->"Bold"], " ", \(\[ExponentialE]\^\(-x\^2\)\), " ", \(\(y'\)' - 2 x\ y' + 2 n\ y = 0\)} }], "\[NoBreak]"}], TraditionalForm]], "Text"], Cell["\<\ \ \>", "Text"], Cell["\<\ There are different kinds of special functions that are not polynomials. The \ ordinary trigonometric functions arising from the differential equation of \ the harmonic motion are just the simplest example\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Hermite Equation", "Subsection"], Cell[BoxData[ \(\(hermiteEq = \(\(y'\)'\)[x] - 2 x\ \(y'\)[x] + 2 n\ y[x] == 0; \)\)], "Input"], Cell["\<\ Here we set up a list of replacement rules that exploit the fact \ that the derivative of a power series starting from zero loses its constant \ terms\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(ys = Sum[\(a\_k\) x\^k, {k, 0, \[Infinity]}]; \n rules = {y[x] \[Rule] ys, \[IndentingNewLine]\(y'\)[x] \[Rule] SumSplit[SumD[ys, x], 1], \[IndentingNewLine]\(\(y'\)'\)[x] \[Rule] SumSplit[SumD[ys, {x, 2}], 2]}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{ RowBox[{\(y(x)\), "\[Rule]", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}], ",", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], "\[Rule]", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(k - 1\)\ a\_k\)}], HoldForm], "TraditionalForm"]}], ",", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}], "\[Rule]", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"]}]}], "}"}], TraditionalForm]], "Output"] }, Open ]], Cell["Plugging this into the orignal equation yields", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(hermiteEq /. rules // BringIn\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-2\)\ k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(2\ n\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ As usual we handle the expression with the aim to reduce all sums \ to a single sum equated to zero. Shifting indices so that every sum will \ feature the same power of x is the first step.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = SumExponentAlign[%, x, k -> k] // SumSimplifyEach\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-2\)\ k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(2\ n\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k\^2 + 3\ k + 2)\)\ x\^k\ a\_\(k + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ There are two way to make every sum start from the same index. \ Either we explicitate the terms in excess (that happens to be in the second \ and third sums)...\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumSplit[%, 1] // SumSimplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(2\ n\ a\_0\), "+", \(2\ a\_2\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \(( \((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) - 2\ \((k - n)\)\ a\_k)\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "(but this approach has a shortcoming: it gives an additional equation for \ the coefficient of x^0 - namely ", Cell[BoxData[ \(TraditionalForm\`a\_2 = \(-n\)\ a\_0\)]], "- that is not strictly necessary to our purpose)\n...or we consider the \ fact that the first sum has a term proprtional to k that goes to zero when \ k=0. It is then immaterial whether its summation index start from zero or \ from one. " }], "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^k\ a\_k\)}], "=", RowBox[{ RowBox[{"0", "+", TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], " ", \(k\ x\^k\ a\_k\)}], HoldForm]}], "=", TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], " ", \(k\ x\^k\ a\_k\)}], HoldForm]}]}]}], TraditionalForm]], "Text"], Cell["\<\ We simply have to apply a transformation to the first sum to change \ the value of the starting value without touching anythig else. We can use \ MapAt in conjuction with SumPosition to identify the position of the first \ sum inside the equation.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(MapAt[ \((# /. Sum[el_, {k, 1, end_}] \[RuleDelayed] Sum[el, {k, 0, end}]) \)&, eqs, SumPosition[eqs, 1]] // SumSimplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \(( \((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) - 2\ \((k - n)\)\ a\_k) \)\)}], HoldForm], "TraditionalForm"], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ A power series is identically zero for every x iff its coefficients \ are all zero. We can obtain the equation stating the condition on the \ coefficients by simply suppressing the Sum structure. Solving for the highest \ coefficient will give us a recursion relation\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(eqr = SumToTerm[%]\), \(\n\), \(\(Solve[Coefficient[eqr[\([1]\)], x, k] == 0, a\_\(k + 2\)]\)[\([1]\)] \)}], "Input"], Cell[BoxData[ \(TraditionalForm \`x\^k\ \((\((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) - 2\ \((k - n)\)\ a\_k) \) == 0\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{a\_\(k + 2\) \[Rule] \(2\ \((k - n)\)\ a\_k\)\/\(k\^2 + 3\ k + 2\)} \)], "Output"] }, Open ]], Cell["\<\ We have all we need to compute a series solution of Hermite's \ equation.\ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{\(a\_0 = y(0)\), "\n", "\t", RowBox[{\(a\_1\), "=", RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}]}], "\n", "\t", \(a\_\(k + 2\) \[Rule] \(\(2\ \((k - n)\)\ \)\/\(\((k + 1)\)\ \((k + 2)\)\)\) a\_k\)}]}], TraditionalForm]], "Text"], Cell[TextData[{ "The presence of the (k-n) factor has the effect of turning the n-th \ coefficient to zero, no matter the initial conditions chosen. Since the \ generic coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_\(k + 2\)\)]], "depends upon the k-th computed coefficient this will turn to zero every \ next coefficient. If n is odd, this means that odds coefficients beyond ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], "will be zero. If n is even, then all even coefficients beyond ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], "wll be zero. At least one solution of the Hermite equation, for integer n, \ is a polynomial of degree n, then. We can make all other coefficients zero by \ setting the initial conditions (the values of ", Cell[BoxData[ \(TraditionalForm\`a\_0\)]], "and ", Cell[BoxData[ \(TraditionalForm\`a\_1\)]], "). " }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[{\(\(y'\)'\)[x] - 2 x\ \(y'\)[x] + 2\ n\ y[x] == 0}, y[x], x] // EnableSumEvaluation\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{"{", RowBox[{\(y(x)\), "\[Rule]", RowBox[{ RowBox[{"x", " ", SubscriptBox[ TagBox["c", C], "2"], " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(1\/2 - n\/2\), (Editable -> True)], ";", TagBox[\(3\/2\), (Editable -> True)], ";", TagBox[\(x\^2\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]]}], "+", RowBox[{ SubscriptBox[ TagBox["c", C], "1"], " ", TagBox[ RowBox[{\(\(\[ThinSpace]\_1\) F\_1\), "(", RowBox[{ TagBox[\(-\(n\/2\)\), (Editable -> True)], ";", TagBox[\(1\/2\), (Editable -> True)], ";", TagBox[\(x\^2\), (Editable -> True)]}], ")"}], InterpretTemplate[ Hypergeometric1F1[ #, #2, #3]&]]}]}]}], "}"}], "}"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["Hermite polynomial for even n", "Subsubsection"], Cell[BoxData[ \(TraditionalForm\`\(\t a\_0 = \(1\n\ta\_1 = 0\n\ta\_\(k + 2\) \[Rule] \(\(2\ \((k - n)\)\ \)\/\(\((k + 1)\)\ \((k + 2)\)\)\) a\_k\)\)\)], "Text"], Cell[BoxData[ \(ae[0] = 1; \nae[1] = 0; \n ae[k_\ /; k \[GreaterEqual] 2] := \(ae[k] = \(\(2\ \((k - 2 - n)\)\ \)\/\(k \((k - 1)\)\)\) ae[k - 2]\)\)], "Input"], Cell["Here are the first ten coefficients", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(evenCoeff = Table[ae[k], {k, 0, 10}]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{1, 0, \(-n\), 0, \(-\(1\/6\)\)\ \((2 - n)\)\ n, 0, \(-\(1\/90\)\)\ \((2 - n)\)\ \((4 - n)\)\ n, 0, \(-\(\(\((2 - n)\)\ \((4 - n)\)\ \((6 - n)\)\ n\)\/2520\)\), 0, \(-\(\(\((2 - n)\)\ \((4 - n)\)\ \((6 - n)\)\ \((8 - n)\)\ n\)\/113400 \)\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((evenCoeff /. n \[Rule] #)\)&\)/@{0, 2, 4, 6, 8, 10}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"1", "0", \(-2\), "0", "0", "0", "0", "0", "0", "0", "0"}, {"1", "0", \(-4\), "0", \(4\/3\), "0", "0", "0", "0", "0", "0"}, {"1", "0", \(-6\), "0", "4", "0", \(-\(8\/15\)\), "0", "0", "0", "0"}, {"1", "0", \(-8\), "0", "8", "0", \(-\(32\/15\)\), "0", \(16\/105\), "0", "0"}, {"1", "0", \(-10\), "0", \(40\/3\), "0", \(-\(16\/3\)\), "0", \(16\/21\), "0", \(-\(32\/945\)\)} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]], Cell["Our series is", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((hermiteEven = % . Table[x^k, {k, 0, 10}])\) // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {"1"}, {\(1 - 2\ x\^2\)}, {\(\(4\ x\^4\)\/3 - 4\ x\^2 + 1\)}, {\(\(-\(\(8\ x\^6\)\/15\)\) + 4\ x\^4 - 6\ x\^2 + 1\)}, { \(\(16\ x\^8\)\/105 - \(32\ x\^6\)\/15 + 8\ x\^4 - 8\ x\^2 + 1 \)}, { \(\(-\(\(32\ x\^10\)\/945\)\) + \(16\ x\^8\)\/21 - \(16\ x\^6\)\/3 + \(40\ x\^4\)\/3 - 10\ x\^2 + 1\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {1, Plus[ 1, Times[ -2, Power[ x, 2]]], Plus[ 1, Times[ -4, Power[ x, 2]], Times[ Rational[ 4, 3], Power[ x, 4]]], Plus[ 1, Times[ -6, Power[ x, 2]], Times[ 4, Power[ x, 4]], Times[ Rational[ -8, 15], Power[ x, 6]]], Plus[ 1, Times[ -8, Power[ x, 2]], Times[ 8, Power[ x, 4]], Times[ Rational[ -32, 15], Power[ x, 6]], Times[ Rational[ 16, 105], Power[ x, 8]]], Plus[ 1, Times[ -10, Power[ x, 2]], Times[ Rational[ 40, 3], Power[ x, 4]], Times[ Rational[ -16, 3], Power[ x, 6]], Times[ Rational[ 16, 21], Power[ x, 8]], Times[ Rational[ -32, 945], Power[ x, 10]]]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We can see that the polynomials obey the initial conditions y(0)=1, \ y'(0)=0, i.e. they pass with zero slope by the point (0,1)\ \>", "Text"], Cell[BoxData[ \(\(Plot[Evaluate[hermiteEven], {x, \(-1\), 1}, Frame \[Rule] True]; \)\)], "Input"], Cell[TextData[{ "These polynomials differs from those given by ", StyleBox["Mathematica", FontSlant->"Italic"], " only by a (signed) normalization factor." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[Simplify[hermiteEven[\([n + 1]\)]/HermiteH[2 n, x]], {n, 0, 5}] \)], "Input"], Cell[BoxData[ \(TraditionalForm \`{1, \(-\(1\/2\)\), 1\/12, \(-\(1\/120\)\), 1\/1680, \(-\(1\/30240\)\)} \)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Hermite polynomial for odd n", "Subsubsection"], Cell[BoxData[ \(TraditionalForm\`\(\t a\_0 = \(0\n\ta\_1 = 1\n\ta\_\(k + 2\) \[Rule] \(\(2\ \((k - n)\)\ \)\/\(\((k + 1)\)\ \((k + 2)\)\)\) a\_k\)\)\)], "Text"], Cell[BoxData[ \(ao[0] = 0; \nao[1] = 1; \n ao[k_\ /; k \[GreaterEqual] 2] := \(ao[k] = \(\(2\ \((k - 2 - n)\)\ \)\/\(k \((k - 1)\)\)\) ao[k - 2]\)\)], "Input"], Cell["Here are the first ten coefficients", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(oddCoeff = Table[ao[k], {k, 0, 9}]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{0, 1, 0, \(1 - n\)\/3, 0, 1\/30\ \((1 - n)\)\ \((3 - n)\), 0, 1\/630\ \((1 - n)\)\ \((3 - n)\)\ \((5 - n)\), 0, \(\((1 - n)\)\ \((3 - n)\)\ \((5 - n)\)\ \((7 - n)\)\)\/22680}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\((oddCoeff /. n \[Rule] #)\)&\)/@{1, 3, 5, 7, 9}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "1", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", \(-\(2\/3\)\), "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", \(-\(4\/3\)\), "0", \(4\/15\), "0", "0", "0", "0"}, {"0", "1", "0", \(-2\), "0", \(4\/5\), "0", \(-\(8\/105\)\), "0", "0"}, {"0", "1", "0", \(-\(8\/3\)\), "0", \(8\/5\), "0", \(-\(32\/105\)\), "0", \(16\/945\)} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}], TraditionalForm]], "Output"] }, Open ]], Cell["Our terinating series are", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((hermiteOdd = % . Table[x^k, {k, 0, 9}])\) // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {"x"}, {\(x - \(2\ x\^3\)\/3\)}, {\(\(4\ x\^5\)\/15 - \(4\ x\^3\)\/3 + x\)}, {\(\(-\(\(8\ x\^7\)\/105\)\) + \(4\ x\^5\)\/5 - 2\ x\^3 + x\)}, { \(\(16\ x\^9\)\/945 - \(32\ x\^7\)\/105 + \(8\ x\^5\)\/5 - \(8\ x\^3\)\/3 + x\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {x, Plus[ x, Times[ Rational[ -2, 3], Power[ x, 3]]], Plus[ x, Times[ Rational[ -4, 3], Power[ x, 3]], Times[ Rational[ 4, 15], Power[ x, 5]]], Plus[ x, Times[ -2, Power[ x, 3]], Times[ Rational[ 4, 5], Power[ x, 5]], Times[ Rational[ -8, 105], Power[ x, 7]]], Plus[ x, Times[ Rational[ -8, 3], Power[ x, 3]], Times[ Rational[ 8, 5], Power[ x, 5]], Times[ Rational[ -32, 105], Power[ x, 7]], Times[ Rational[ 16, 945], Power[ x, 9]]]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Se the effect of the different I.C. on these solutions: they all \ pass by the origin with slope 1.\ \>", "Text"], Cell[BoxData[ \(\(Plot[Evaluate[hermiteOdd], {x, \(-1\), 1}, Frame \[Rule] True]; \)\)], "Input"], Cell[TextData[{ "These polynomials differ from those given by ", StyleBox["Mathematica", FontSlant->"Italic"], " only by a normalization factor. The values are the same seen in the case \ for even n." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[ Simplify[hermiteOdd[\([n + 1]\)]/HermiteH[2 n + 1, x]], {n, 0, 4}]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{1\/2, \(-\(1\/12\)\), 1\/120, \(-\(1\/1680\)\), 1\/30240}\)], "Output"] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Legendre Equation (*)", "Subsection"], Cell[BoxData[ \(\(\ \(legendreEq = \((1 - x\^2)\) \(\(y'\)'\)[x] - 2 x\ \(y'\)[x] + n \((n + 1)\) y[x] \[Equal] 0; \)\)\)], "Input"], Cell[TextData[{ "The coefficient of the highest derivative is ", Cell[BoxData[ \(TraditionalForm\`\((1 - x\^2)\)\)]], "and is not zero in x=0. We can then look for a power series solution with \ center in x=0." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = legendreEq /. { y[x] \[Rule] \[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, \[IndentingNewLine]\(y'\)[x] \[Rule] SumSplit[SumD[\[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, x], 1], \[IndentingNewLine]\(\(y'\)'\)[x] \[Rule] SumSplit[ SumD[\[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, {x, 2}], 2]} \)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\((1 - x\^2)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"]}], "-", RowBox[{"2", " ", "x", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^\(k - 1\)\ a\_k\)}], HoldForm], "TraditionalForm"]}], "+", RowBox[{"n", " ", \((n + 1)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Expanding every sum will show sums with different endpoints and \ different values for the exponent of the general term. \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumExpandAll[eqs] // BringIn\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-k\)\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\^2\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-2\)\ k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-k\^2\)\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Shifting the indices to make all the power of x alike, will yield \ the following equation, that can be further simplified by splitting the sums \ at the highest startpoint, i.e. k=2.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(SumExponentAlign[%, x, k \[Rule] k]\), \(\n\), \(eq = SumSplit[%, 2] // SumSimplify\)}], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-2\)\ k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(k\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-k\^2\)\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^k\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-\((k + 2)\)\)\ x\^k\ a\_\(k + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k + 2)\)\^2\ x\^k\ a\_\(k + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(a\_0\ n\^2\), "+", \(x\ a\_1\ n\^2\), "+", \(a\_0\ n\), "+", \(x\ a\_1\ n\), "-", \(2\ x\ a\_1\), "+", \(2\ a\_2\), "+", \(6\ x\ a\_3\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \(( \((\(-k\^2\) - k + n\^2 + n)\)\ a\_k + \((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We now have an equation that can be easily solved: applying the \ principle of identity of polynomials will result in three equations\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(eqr = SumToTerm[eq]; \)\), \(\n\), \(\(({eq1, eq2, eq3} = {SumCoefficient[eqr[\([1]\)], x, 0] \[Equal] 0, \[IndentingNewLine]SumCoefficient[eqr[\([1]\)], x, 1] \[Equal] 0, \[IndentingNewLine]SumCoefficient[eqr[\([1]\)], x, k] \[Equal] 0}) \) // ColumnForm\)}], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(a\_0\ n\^2 + a\_0\ n + 2\ a\_2 == 0\)}, {\(a\_1\ n\^2 + a\_1\ n - 2\ a\_1 + 6\ a\_3 == 0\)}, { \(\((\(-k\^2\) - k + n\^2 + n)\)\ a\_k + \((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) == 0\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Equal[ Plus[ Times[ n, Subscript[ a, 0]], Times[ Power[ n, 2], Subscript[ a, 0]], Times[ 2, Subscript[ a, 2]]], 0], Equal[ Plus[ Times[ -2, Subscript[ a, 1]], Times[ n, Subscript[ a, 1]], Times[ Power[ n, 2], Subscript[ a, 1]], Times[ 6, Subscript[ a, 3]]], 0], Equal[ Plus[ Times[ Plus[ Times[ -1, k], Times[ -1, Power[ k, 2]], n, Power[ n, 2]], Subscript[ a, k]], Times[ Plus[ 2, Times[ 3, k], Power[ k, 2]], Subscript[ a, Plus[ 2, k]]]], 0]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Solving w.r.t. the highest coefficient in each equation yields the \ recursion relation needed to compute every coefficient in the power series \ solution. We factorize the results to achieve a neater form\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\((Flatten[ \[IndentingNewLine]{Solve[eq1, a\_2], Solve[eq2, a\_3], Solve[eq3, a\_\(k + 2\)]}] /. Rule[a_, b_] \[RuleDelayed] Rule[a, Factor[b]])\) // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ {\(a\_2 \[Rule] \(-\(1\/2\)\)\ n\ \((n + 1)\)\ a\_0\)}, {\(a\_3 \[Rule] \(-\(1\/6\)\)\ \((n - 1)\)\ \((n + 2)\)\ a\_1\)}, { \(a\_\(k + 2\) \[Rule] \(\((k - n)\)\ \((k + n + 1)\)\ a\_k\)\/\(\((k + 1)\)\ \((k + 2)\)\)\)} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ {Subscript[ a, 2] -> Times[ Rational[ -1, 2], n, Plus[ 1, n], Subscript[ a, 0]], Subscript[ a, 3] -> Times[ Rational[ -1, 6], Plus[ -1, n], Plus[ 2, n], Subscript[ a, 1]], Subscript[ a, Plus[ 2, k]] -> Times[ Power[ Plus[ 1, k], -1], Power[ Plus[ 2, k], -1], Plus[ k, Times[ -1, n]], Plus[ 1, k, n], Subscript[ a, k]]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Even coefficients happen to depend only on the initial value of y, \ while odd coefficients depends on the initial value of the first derivative \ y'. We can identify two sequences of coefficients \ \>", "Text"], Cell[BoxData[ FormBox[ RowBox[{GridBox[{ {\(a\_0 = y\_0\), " ", \(a\_1 = yp\_0\)}, {\(a\_2 = \(-\(\(\ n\ \((n + 1)\)\)\/\(2!\)\)\)\ y\_0\), " ", \(a\_3 = \(-\(\(\((n - 1)\)\ \((n + 2)\)\)\/\(3!\)\)\)\ \ yp\_0\)}, { \(a\_4 = \(\(-\(\(\((n - 2)\) a\_2\ \((n + 3)\)\)\/12\)\) = \(\((n - 2)\)\ n\ \((n + 1)\)\ \((n + 3)\)\)\/\(4!\)\ \ y\_0\)\), " ", \(a\_5 = \(\(\ \((n - 3)\) a\_3\ \((n + 4)\)\)\/20 = \(\(\ \((n - 3)\)\ \((n - 1)\)\ \((n + 2)\)\ \((n + 4)\)\)\/\(5!\)\) yp\_0\)\)}, { \(a\_6 = \(\(-\(\(\((n - 4)\) a\_4\ \((n + 5)\)\)\/30\)\) = \(-\(\(\((n - 4)\)\ \((n - 2)\)\ n\ \((n + 1)\)\ \((n + 3)\)\ \((n + 5)\)\)\/\(6!\)\)\)\ \ y\_0\)\), " ", \(a\_7 = \(\(-\(\(\ \((n - 5)\) a\_5\ \((n + 6)\)\)\/42\)\) = \(\(\((n - 5)\)\ \((n - 3)\)\ \((n - 1)\)\ \((n + 2)\)\ \((n + 4)\)\ \((n + 6)\)\ \)\/\(7!\)\) yp\_0\)\)}, {"\[Ellipsis]", " ", "\[Ellipsis]"} }], "\[NoBreak]"}], TraditionalForm]], "Text", GridBoxOptions->{ColumnAlignments->{Left}}], Cell["\<\ An interesting thing to note is that, since each sequence depends \ upon the previous coefficient, and since for certain integer values of n it \ is possible to set to zero one of the coefficients, then our series will \ terminate in a polynomial. In particular, for even n we will have a finite \ sequence of even coefficients (and an infinite series with odd coefficients), \ while for odd n we will find a polynomial in odd powers of x (and an infinite \ series in even powers of x). If we write the generic even and odd \ coefficients as\ \>", "Text"], Cell[TextData[{ "\t", Cell[BoxData[ \(TraditionalForm \`a\_\(2 m\) = \((\(-1\))\)\^m\ \(\(\(\((n - 2 m + 2)\)\ \((n - 2 m + 4)\) ... \)\ n\ \((n + 1)\) ... \)\ \((n + 2 m - 3)\) \((n + 2 m - 1)\)\)\/\(\((2 m)\)!\)\ \ y\_0\)]], "\n\t", Cell[BoxData[ \(TraditionalForm \`a\_\(2 m + 1\) = \((\(-1\))\)\^m\ \(\(\(\((n - 2 m + 1)\)\ \((n - 2 m + 3)\) ... \)\ \((n - 1)\)\ \((n + 2)\) ... \)\ \((n + 2 m - 2)\) \((n + 2 m)\)\)\/\(\((2 m + 1)\)!\)\ \ yp\_0\)]] }], "Text"], Cell["Then we can express our solution in the following way", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{ \(\(y\_n\)(x)\[AlignmentMarker] = a\_0 + \[Sum]\+\(m = 1\)\%\[Infinity]\(\((\(-1\))\)\^m\) \(\(\(\(\((n - 2 m + 2)\)\ \((n - 2 m + 4)\) ... \) \((n - 2)\)\ n\ \((n + 1)\) ... \)\ \((n + 2 m - 3)\) \((n + 2 m - 1)\)\)\/\(\((2 m)\)! \)\) \(a\_0\) x\^\(2 m\) + \[IndentingNewLine]\(a\_1\) x + \[Sum]\+\(m = 1\)\%\[Infinity]\((\(-1\))\)\^m\ \(\(\(\(\((n - 2 m + 1)\)\ \((n - 2 m + 3)\) ... \)\ \((n - 1)\)\ \((n + 2)\) ... \)\ \((n + 2 m - 2)\) \((n + 2 m)\)\)\/\(\((2 m + 1)\)! \)\) \(a\_1\) x\^\(2 m - 1\)\), "\[IndentingNewLine]", "\[AlignmentMarker]", RowBox[{"=", RowBox[{ \(\(y(0)\) \((1 + \[Sum]\+\(n = 1\)\%\[Infinity]\( a\_\(2 n\)\) x\^\(2 n\))\)\), "+", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}], \((x + \[Sum]\+\(n = 1\)\%\[Infinity]\( a\_\(2 n + 1\)\) x\^\(2 n + 1\))\)}]}]}]}]}], TraditionalForm]], "Text", TextAlignment->AlignmentMarker], Cell[TextData[{ "For even n we obtain an even polynomial multiplied by y(0).For odd n we \ get an odd polynomial multiplied by y'(0)The polynomials are named ", StyleBox["Legendre polynomial", FontSlant->"Italic"], " (LegendreP).The other linear independent solution is known as a ", StyleBox["Legendre function of the second kind", FontSlant->"Italic"], " and it is customary to denote it with the letter Q (LegendreQ)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[{ \((1 - x\^2)\) \(\(y'\)'\)[x] - 2 x\ \(y'\)[x] + n \((n + 1)\) y[x] \[Equal] 0}, y[x], x] // EnableSumEvaluation \)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{"{", RowBox[{\(y(x)\), "\[Rule]", RowBox[{ RowBox[{ SubscriptBox[ TagBox["c", C], "1"], " ", RowBox[{ SubscriptBox[ TagBox["P", LegendreP], "n"], "(", "x", ")"}]}], "+", RowBox[{ SubscriptBox[ TagBox["c", C], "2"], " ", RowBox[{ SubscriptBox[ TagBox["Q", LegendreQ], "n"], "(", "x", ")"}]}]}]}], "}"}], "}"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Moreover, if we specify the initial conditions so that the a0 is \ zero for odd n and a1 is zero for even n, the particular solution obtained is \ the legendre polynomial of order n.\ \>", "Text"], Cell[CellGroupData[{ Cell["Legendre Polynomials for even n", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(LegendreP[0, x]\), \(LegendreP[2, x]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`1\)], "Output"], Cell[BoxData[ \(TraditionalForm\`\(3\ x\^2\)\/2 - 1\/2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Series[LegendreQ[2, x], {x, 0, 12}]\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[ RowBox[{ \(-\(2\ x\)\), "+", \(\(4\ x\^3\)\/3\), "+", \(\(2\ x\^5\)\/5\), "+", \(\(8\ x\^7\)\/35\), "+", \(\(10\ x\^9\)\/63\), "+", \(\(4\ x\^11\)\/33\), "+", InterpretationBox[\(O(x\^13)\), SeriesData[ x, 0, {}, 1, 13, 1]]}], SeriesData[ x, 0, {-2, 0, Rational[ 4, 3], 0, Rational[ 2, 5], 0, Rational[ 8, 35], 0, Rational[ 10, 63], 0, Rational[ 4, 33]}, 1, 13, 1]], TraditionalForm]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Legendre Polynomials for odd n", "Subsubsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(LegendreP[1, x]\), \(LegendreP[3, x]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`x\)], "Output"], Cell[BoxData[ \(TraditionalForm\`\(5\ x\^3\)\/2 - \(3\ x\)\/2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Series[LegendreQ[1, x], {x, 0, 12}]\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[ RowBox[{ \(-1\), "+", \(x\^2\), "+", \(x\^4\/3\), "+", \(x\^6\/5\), "+", \(x\^8\/7\), "+", \(x\^10\/9\), "+", \(x\^12\/11\), "+", InterpretationBox[\(O(x\^13)\), SeriesData[ x, 0, {}, 0, 13, 1]]}], SeriesData[ x, 0, {-1, 0, 1, 0, Rational[ 1, 3], 0, Rational[ 1, 5], 0, Rational[ 1, 7], 0, Rational[ 1, 9], 0, Rational[ 1, 11]}, 0, 13, 1]], TraditionalForm]], "Output"] }, Open ]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Airy Equation (*)", "Subsection"], Cell[BoxData[ \(\(airyEq = \ \(\(y'\)'\)[x] - x\ y[x] \[Equal] 0; \)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = \[Sum]\+\(k = 0\)\%\[Infinity]\( a\_k\) x\^k, \ y2s = SumSplit[SumD[ys, {x, 2}], 2]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ a\_k\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Summa[ Times[ Power[ x, k], Subscript[ a, k]], {k, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ -1, k], k, Power[ x, Plus[ -2, k]], Subscript[ a, k]], {k, 2, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = airyEq /. {y[x] \[Rule] ys, \(\(y'\)'\)[x] \[Rule] y2s} // BringIn\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 2\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k - 1)\)\ k\ x\^\(k - 2\)\ a\_k\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-x\^\(k + 1\)\)\ a\_k\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(SumExponentAlign[eqs, x, k -> k] // Simplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-x\^k\)\ a\_\(k - 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((k\^2 + 3\ k + 2)\)\ x\^k\ a\_\(k + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ It's about time to gather everything under the same sum sign. We \ just have to split the second sum at k=1 to get\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(SumSplit[%, 1] // SumSimplify\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(2\ a\_2\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(k = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^k\ \((\((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) - a\_\(k - 1\)) \)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We can now obtain the recursion relation. To speed things up a bit \ we mix the k-th coefficient with the coefficient of the zero-th power of \ x\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(eqr = SumToTerm[%]\), \(\(Solve[Coefficient[eqr[\([1]\)], x, 0] == 0, a\_2]\)[\([1]\)]\), \(\(Solve[Coefficient[eqr[\([1]\)], x, k] == 0, a\_\(k + 2\)]\)[\([1]\)] \)}], "Input"], Cell[BoxData[ \(TraditionalForm \`\((\((k\^2 + 3\ k + 2)\)\ a\_\(k + 2\) - a\_\(k - 1\))\)\ x\^k + 2\ a\_2 == 0\)], "Output"], Cell[BoxData[ \(TraditionalForm\`{a\_2 \[Rule] 0}\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{a\_\(k + 2\) \[Rule] a\_\(k - 1\)\/\(k\^2 + 3\ k + 2\)}\)], "Output"] }, Open ]], Cell["\<\ This recursion relation enable us to compute every coefficient of \ the power series of the solution of Airy's equation in a neighbor of \ x=0.\ \>", "Text"], Cell[TextData[{ "\t", Cell[BoxData[ \(TraditionalForm\`a\_0 = y(0)\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`a\_1 = y' \((0)\)\)]], "\n\t", Cell[BoxData[ \(TraditionalForm\`a\_2 = 0\)]], "\n\t", Cell[BoxData[ FormBox[ RowBox[{\(a\_\(k + 2\)\), "=", RowBox[{ FractionBox["1", FormBox[\(\((k + 1)\)\ \((k + 2)\)\), "TraditionalForm"]], \(a\_\(k - 1\)\)}]}], TraditionalForm]]] }], "Text"], Cell[TextData[{ "We can now build a table of the first few coefficients that will depend \ upon the coefficients ", Cell[BoxData[ \(TraditionalForm\`a\_0\)]], "and ", Cell[BoxData[ \(TraditionalForm\`a\_1\)]], "and ultimately upon the initial conditions y(0) and y'(0). Since the \ generic coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_k\)]], "(for k>2) is a function of the the (k-3)th coefficient only," }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(% /. k \[Rule] k - 2 // Simplify\)], "Input"], Cell[BoxData[ \(TraditionalForm\`{a\_k \[Rule] a\_\(k - 3\)\/\(\((k - 1)\)\ k\)}\)], "Output"] }, Open ]], Cell[TextData[{ "we can immediately infer that - being ", Cell[BoxData[ \(TraditionalForm\`a\_2 = 0\)]], "- all the coefficients with index (2+3 n) are zero. The remaining \ coefficients will ultimately depen upon ", Cell[BoxData[ \(TraditionalForm\`a\_1\)]], "(i.e. y'(0)) and ", Cell[BoxData[ \(TraditionalForm\`a\_0\)]], "(i.e. y(0)). We are going to find two independent series solutions that \ will be given a name for their importance in certain physical applications." }], "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t ", GridBox[{ {\(a\_0 = y\_0\), " ", RowBox[{\(a\_1\), "=", SubsuperscriptBox["y", "0", "\[Prime]", MultilineFunction->None]}], " ", \(a\_2 = 0\)}, {\(a\_3 = \(a\_0\/\(3\ \((3 - 1)\)\) = y\_0\/\(3\ 2\)\)\), " ", RowBox[{\(a\_4\), "=", RowBox[{\(a\_1\/\(4\ \((4 - 1)\)\)\), "=", FractionBox[ SubsuperscriptBox["y", "0", "\[Prime]", MultilineFunction->None], \(4\ 3\)]}]}], " ", \(a\_5 = \(a\_2\/\(5\ \((5 - 1)\)\) = 0\)\)}, {\(a\_6 = \(a\_3\/\(6\ \((6 - 1)\)\) = y\_0\/\(6\ 5\ 3\ 2\)\)\), " ", RowBox[{\(a\_7\), "=", RowBox[{\(a\_4\/\(7\ \((7 - 1)\)\)\), "=", FractionBox[ SubsuperscriptBox["y", "0", "\[Prime]", MultilineFunction->None], \(7\ 6\ 4\ 3\)]}]}], " ", \(a\_8 = \(a\_5\/\(8\ \((8 - 1)\)\) = 0\)\)}, {"\[Ellipsis]", " ", "\[Ellipsis]", " ", "\[Ellipsis]"}, { \(a\_\(3\ n\) = y\_0\/\(\((\((3\ n)\)\ \((3\ n - 1)\))\) \[Ellipsis]\ \((6\ 5)\)\ \((3\ 2)\)\)\), " ", RowBox[{\(a\_\(3\ n + 1\)\), "=", FractionBox[ SubsuperscriptBox["y", "0", "\[Prime]", MultilineFunction->None], \(\((\((3\ n + 1)\) \((\ 3\ n)\))\) \[Ellipsis]\ \((7\ 6)\)\ \((4\ 3)\)\)]}], " ", \(a\_\(3\ n + 2\) = 0\)} }], "\[NoBreak]"}], TraditionalForm]], "Text", GridBoxOptions->{ColumnAlignments->{Left}}], Cell["We can write our solution in the following way", "Text"], Cell[BoxData[ FormBox[ RowBox[{"\t", RowBox[{ RowBox[{\(y(x)\), "\[AlignmentMarker]", "=", RowBox[{ \(a\_0\), "+", \(\(a\_1\) x\), "+", \(\[Sum]\+\(n = 1\)\%\[Infinity]\(\( a\_0\) x\^\(3 n\)\)\/\(\((\((3\ n)\)\ \((3\ n - 1)\))\)\ \[Ellipsis]\ \((6\ 5)\)\ \((3\ 2)\)\)\), "+", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}], \(\[Sum]\+\(n = 1\)\%\[Infinity]\(\( a\_1\) x\^\(3 n + 1\)\)\/\(\((\((3\ n + 1)\)\ \((3\ n)\))\)\ \[Ellipsis]\ \((7\ 6)\)\ \((4\ 3)\)\)\)}]}]}], "\[IndentingNewLine]", "\[AlignmentMarker]", RowBox[{"=", RowBox[{ \(\(y(0)\) \((1 + \[Sum]\+\(n = 1\)\%\[Infinity] x \^\(3 n\)\/\(\((\((3\ n)\)\ \((3\ n - 1)\))\)\ \[Ellipsis]\ \((6\ 5)\)\ \((3\ 2)\)\))\)\), "+", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "0", ")"}], \((x + \[Sum]\+\(n = 1\)\%\[Infinity] x \^\(3 n + 1\)\/\(\((\((3\ n + 1)\)\ \((3\ n)\))\)\ \[Ellipsis]\ \((7\ 6)\)\ \((4\ 3)\)\))\)}]}]}]}]}], TraditionalForm]], "Text", TextAlignment->AlignmentMarker], Cell[CellGroupData[{ Cell[BoxData[ \(DSolve[{\[IndentingNewLine]\(\(y'\)'\)[x] - x\ y[x] \[Equal] 0, \[IndentingNewLine]y[0] \[Equal] yo, \[IndentingNewLine]\(y'\)[0] \[Equal] ypo}, y[x], x] // EnableSumEvaluation\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{{y(x) \[Rule] 1\/6\ \(Bi(x)\)\ \((3\ \@3\%6\ \(\[CapitalGamma](2\/3)\)\ yo + 3\^\(5/6\)\ ypo\ \(\[CapitalGamma](1\/3)\))\) + 1\/2\ \(Ai(x)\)\ \((3\^\(2/3\)\ yo\ \(\[CapitalGamma](2\/3)\) - \@3\%3\ ypo\ \(\[CapitalGamma](1\/3)\))\)}}\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[TextData["Bessel Equation for noninteger \[Mu]"], "Subsection"], Cell["This is an instance of Bessel's differential equation", "Text"], Cell[TextData["eq=x^2 y''[x]+x y'[x]+(x^2-\[Mu]^2)y[x]==0;"], "Input"], Cell[TextData[ "the indicial equation has solutions +\[Mu] and - \[Mu]. If the difference 2\ \[Mu] is not an integer (that is when \[Mu] is not an integer or an \ half-integer) we should look for functions in the form"], "Text"], Cell[BoxData[ \(TraditionalForm\`\(\t \(y\_1\)(x) = \(x\^\[Mu]\ \(\[Sum]\+\(n = 0\)\%\[Infinity] a\_n\ x\^n\)\n\t \(\(y\_2\)(x)\) = x\^\(-\[Mu]\)\ \(\[Sum]\+\(n = 0\)\%\[Infinity] b\_n\ x\^n\)\)\)\)], "Text", CellFrame->True, Evaluatable->False, Background->GrayLevel[0.833326]], Cell["\<\ The first function and its derivatives are\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ {ys = x^\[Mu]\ Sum[a\_n\ x^n, {n, 0, Infinity}], \t\n\t y1s = SumD[ys, x], y2s = SumD[y1s, x]} // ColumnForm\)\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{\(x\^\[Mu]\), " ", FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + \[Mu] - 1\)\ \((n + \[Mu])\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + \[Mu] - 2\)\ \((n + \[Mu] - 1)\)\ \((n + \[Mu])\)\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, \[Mu]], Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Power[ x, Plus[ -1, n, \[Mu]]], Plus[ n, \[Mu]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Power[ x, Plus[ -2, n, \[Mu]]], Plus[ -1, n, \[Mu]], Plus[ n, \[Mu]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Let's plug them into the equation, expand all the sums and bring \ all factors inside the sums.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpand[\t \tBringIn[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] \t]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"2", " ", "\[Mu]", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n + \[Mu]\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n + \[Mu]\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + \[Mu] + 2\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Next step: we align the exponents to the highest power", "Text"], Cell[CellGroupData[{ Cell[TextData["eqs2=SumExponentAlign[eqs,x,n->n+\[Mu]+2]"], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + \[Mu] + 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\^2\ x\^\(n + \[Mu] + 2\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(2\ \((n + 2)\)\ x\^\(n + \[Mu] + 2\)\ \[Mu]\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ Now we break each sum in order to have them all starting from \ n=0.\ \>", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,0]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(2\ \[Mu]\ a\_1\ x\^\(\[Mu] + 1\)\), "+", \(a\_1\ x\^\(\[Mu] + 1\)\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + \[Mu] + 2\)\ \((a\_n + \((n + 2)\)\ \((n + 2\ \[Mu] + 2)\)\ a\_\(n + 2\)) \)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "And finally we apply the principle of identity of polynomials, solving for \ the coefficents. We obtain the recursion relation for the coefficient ", Cell[BoxData[ \(TraditionalForm\`a\_n\)]], "of the power expansion." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Solve[Coefficient[eqs2[\([1]\)], \ x^\((\[Mu] + 1)\)]\ == \ 0, \ a\_1]\)[\([1]\)]\), \(\(Solve[SumCoefficient[eqs2, \ x^\((n + \[Mu] + 2)\)]\ == \ 0, \ a\_\(n + 2\)]\)[\([1]\)]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`{a\_1 \[Rule] 0}\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{a\_\(n + 2\) \[Rule] \(-\(a\_n\/\(\((n + 2)\)\ \((n + 2\ \[Mu] + 2)\)\)\)\)}\)], "Output"] }, Open ]], Cell[TextData[ "\n\nIf \[Mu] is not integer or half integer, the second linear indipendent \ solution is obtained in the same manner as before"], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = x^\((\(-\[Mu]\))\) Sum[\(b\_n\) x^n, {n, 0, Infinity}], \t\n\t y1s = SumD[ys, x], y2s = SumD[y1s, x]}\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{"{", RowBox[{ RowBox[{\(x\^\(-\[Mu]\)\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"]}], ",", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - \[Mu] - 1\)\ \((n - \[Mu])\)\ b\_n\)}], HoldForm], "TraditionalForm"], ",", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - \[Mu] - 2\)\ \((n - \[Mu] - 1)\)\ \((n - \[Mu])\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "}"}], TraditionalForm]], "Output"] }, Open ]], Cell["substituting in the eq", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpand[ \tBringIn[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] \t]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(-2\), " ", "\[Mu]", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - \[Mu]\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - \[Mu]\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - \[Mu] + 2\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Alignment to the highest power yields", "Text"], Cell[CellGroupData[{ Cell[TextData["eqs2=SumExponentAlign[eqs,x,n->n-\[Mu]+2]"], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - \[Mu] + 2\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\^2\ x\^\(n - \[Mu] + 2\)\ b\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-2\)\ \((n + 2)\)\ x\^\(n - \[Mu] + 2\)\ \[Mu]\ b\_\(n + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Have them all to start from the highest starting value:", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,0]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(\(-2\)\ \[Mu]\ b\_1\ x\^\(1 - \[Mu]\)\), "+", \(b\_1\ x\^\(1 - \[Mu]\)\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n - \[Mu] + 2\)\ \((b\_n + \((n + 2)\)\ \((n - 2\ \[Mu] + 2)\)\ b\_\(n + 2\)) \)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["Solving for the coefficients yields", "Text"], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Solve[Coefficient[eqs2[\([1]\)], x^\((1 - \[Mu])\)] == 0, b\_1]\)[ \([1]\)]\), \(\(Solve[SumCoefficient[eqs2, x^\((n - \[Mu] + 2)\)] == 0, b\_\(n + 2\)] \)[\([1]\)]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`{b\_1 \[Rule] 0}\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{b\_\(n + 2\) \[Rule] \(-\(b\_n\/\(\((n + 2)\)\ \((n - 2\ \[Mu] + 2)\)\)\)\)}\)], "Output"] }, Open ]], Cell["\<\ Odd coefficients are all set to zero \ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[ "Bessel Equation for a particular case of integer \[Mu] (\[Mu]=2)"], "Subsection"], Cell[TextData[ "Let's see what happens in the case \[Mu] is integer (and hence the \ difference between the solutions of the indicial equation is an integer)"], "Text"], Cell[CellGroupData[{ Cell["eq=x^2 y''[x]+x y'[x]+(x^2-2^2)y[x]==0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", \(x\^2\)}], "+", RowBox[{ RowBox[{ SuperscriptBox["y", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", "x"}], "+", \(\((x\^2 - 4)\)\ \(y(x)\)\)}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ The first solution is in the form\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({ys = x^\((2)\) Sum[\(a\_n\) x^n, {n, 0, Infinity}], \t\n\t y1s = SumD[ys, x], y2s = SumD[ys, {x, 2}]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{\(x\^2\), " ", FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ a\_n\)}], "TraditionalForm"]}]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\ x\^\(n + 1\)\ a\_n\)}], "TraditionalForm"]}, { FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 1)\)\ \((n + 2)\)\ x\^n\ a\_n\)}], "TraditionalForm"]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Times[ Power[ x, 2], Summa[ Times[ Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]], Summa[ Times[ Plus[ 2, n], Power[ x, Plus[ 1, n]], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}], Summa[ Times[ Plus[ 1, n], Plus[ 2, n], Power[ x, n], Subscript[ a, n]], {n, 0, DirectedInfinity[ 1]}]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell["this is the equation, when we replace the above", "Text"], Cell[CellGroupData[{ Cell["\<\ eqs=SumExpand[\t \tBringIn[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] \t]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"4", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n + 2\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n + 2\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 4\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["These are the manipulation to get to the result. ", "Text"], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n+4]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 4\)\ a\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(4\ \((n + 2)\)\ x\^\(n + 4\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-2\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\^2\ x\^\(n + 4\)\ a\_\(n + 2\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,0]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(5\ a\_1\ x\^3\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 4\)\ \((a\_n + \((n\^2 + 8\ n + 12)\)\ a\_\(n + 2\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Solve[Coefficient[eqs2[\([1]\)], \ x^3]\ == \ 0, \ a\_1]\)[\([1]\)] \), \(\n\), \(\ \ sol\ = \ \(Solve[SumCoefficient[eqs2, \ x^\((n\ + \ 4)\)]\ == \ 0, \ a\_\(n + 2\)]\)[\([1]\)]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`{a\_1 \[Rule] 0}\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{a\_\(n + 2\) \[Rule] \(-\(a\_n\/\(n\^2 + 8\ n + 12\)\)\)}\)], "Output"] }, Open ]], Cell["\<\ The second independent solution can be found by introducing a logarithmic \ term. (Again I want to stress the fact that this notebook is just an \ exemplification of the package Summa.m, and there is no pretense of \ mathematical rigor nor - Math forgive me- correctness. The package is just an \ help to avoid cumbersome calculation by hand. But it may lead to wrong \ results if the user does not apply the proper mathematical concepts).\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Clear[a, y1]; \n{ys = x^\((\(-2\))\) Sum[\(b\_n\) x^n, {n, 0, Infinity}] + k\ Log[x]\ y1[x], \n\ y1s = DSum[ys, x], \n\ y2s = DSum[ys, {x, 2}]} // ColumnForm\)], "Input"], Cell[BoxData[ FormBox[ InterpretationBox[GridBox[{ { RowBox[{ FractionBox[ FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], "TraditionalForm"], \(x\^2\)], "+", \(k\ \(log(x)\)\ \(y1(x)\)\)}]}, { RowBox[{ FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 2)\)\ x\^\(n - 3\)\ b\_n\)}], "TraditionalForm"], "+", RowBox[{"k", " ", RowBox[{"(", RowBox[{\(\(y1(x)\)\/x\), "+", RowBox[{\(log(x)\), " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], ")"}]}]}]}, { RowBox[{ FormBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n - 3)\)\ \((n - 2)\)\ x\^\(n - 4\)\ b\_n\)}], "TraditionalForm"], "+", RowBox[{"k", " ", RowBox[{"(", RowBox[{\(-\(\(y1(x)\)\/x\^2\)\), "+", FractionBox[ RowBox[{"2", " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "x"], "+", RowBox[{\(log(x)\), " ", RowBox[{ SuperscriptBox["y1", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], ")"}]}]}]} }, GridBaseline->{Baseline, {1, 1}}, ColumnAlignments->{Left}], ColumnForm[ { Plus[ Times[ Power[ x, -2], Summa[ Times[ Power[ x, n], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}]], Times[ k, Log[ x], y1[ x]]], Plus[ Summa[ Times[ Plus[ -2, n], Power[ x, Plus[ -3, n]], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}], Times[ k, Plus[ Times[ Power[ x, -1], y1[ x]], Times[ Log[ x], Derivative[ 1][ y1][ x]]]]], Plus[ Summa[ Times[ Plus[ -3, n], Plus[ -2, n], Power[ x, Plus[ -4, n]], Subscript[ b, n]], {n, 0, DirectedInfinity[ 1]}], Times[ k, Plus[ Times[ -1, Power[ x, -2], y1[ x]], Times[ 2, Power[ x, -1], Derivative[ 1][ y1][ x]], Times[ Log[ x], Derivative[ 2][ y1][ x]]]]]}], Editable->False], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ eqs=BringIn[ \tSumExpand[ \t\teq/.{y[x]->ys,y'[x]->y1s,y''[x]->y2s}] \t]\ \>", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(k\ \(log(x)\)\ \(y1(x)\)\ x\^2\), "+", RowBox[{"k", " ", \(log(x)\), " ", RowBox[{ SuperscriptBox["y1", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", \(x\^2\)}], "+", RowBox[{"2", " ", "k", " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", "x"}], "+", RowBox[{"k", " ", \(log(x)\), " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", "x"}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\(-4\)\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((n\ x\^\(n - 2\)\ b\_n - 2\ x\^\(n - 2\)\ b\_n)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((n\^2\ b\_n\ x\^\(n - 2\) - 5\ n\ b\_n\ x\^\(n - 2\) + 6\ b\_n\ x\^\(n - 2\))\)}], HoldForm], "TraditionalForm"], "-", \(4\ k\ \(log(x)\)\ \(y1(x)\)\)}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "Let's try to get rid of the logarithm. We work on the left hand side of \ the equation in order to be able to apply ", StyleBox["Mathematica", FontSlant->"Italic"], "'s expression manipulation functions. Collect will pave the way to a nice \ simplification of the above equation" }], "Text"], Cell[CellGroupData[{ Cell["Collect[%[[1]],{k Log[x],x,x^2},BringOut]", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{\(-4\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{"2", " ", "k", " ", "x", " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], "+", RowBox[{"k", " ", \(log(x)\), " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{\(y1(x)\), "+", RowBox[{ SuperscriptBox["y1", "\[Prime]\[Prime]", MultilineFunction->None], "(", "x", ")"}]}], ")"}], " ", \(x\^2\)}], "+", RowBox[{ RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}], " ", "x"}], "-", \(4\ \(y1(x)\)\)}], ")"}]}]}], TraditionalForm]], "Output"] }, Open ]], Cell[TextData[{ "The term in parethesis that multiplies k log(x) is just the left hand \ side of Bessel's equation with y(x)=y1(x). But y1(x) is a solution for that \ equation, and that means that the term in parenthesis is zero.We can simply \ neglect the logarithmic term, and we gladly isntruct ", StyleBox["Mathematica ", FontSlant->"Italic"], "to do so:" }], "Text"], Cell[CellGroupData[{ Cell["eqs= %==0 /.Log[x] _->0", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{\(-4\), " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"], "+", RowBox[{"2", " ", "k", " ", "x", " ", RowBox[{ SuperscriptBox["y1", "\[Prime]", MultilineFunction->None], "(", "x", ")"}]}]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We need to substitute to y1'(x) the corresponding expression in \ term of power series\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs = eqs /. \(y1'\)[x] -> SumD[x^\((2)\) Sum[\(a\_n\) x^n, {n, 0, Infinity}], x]\)], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"2", " ", "k", " ", "x", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n + 2)\)\ x\^\(n + 1\)\ a\_n\)}], HoldForm], "TraditionalForm"]}], "-", RowBox[{"4", " ", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"]}], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(n\^2\ x\^\(n - 2\)\ b\_n\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 0\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^n\ b\_n\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs2=SumExponentAlign[eqs,x,n->n+1]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \((4\ k\ a\_\(n - 1\)\ x\^\(n + 1\) + 2\ k\ \((n - 1)\)\ a\_\(n - 1\)\ x\^\(n + 1\))\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-1\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\)\ b\_\(n + 1\)\)}], HoldForm], "TraditionalForm"], "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = \(-3\)\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(\((n\^2 + 2\ n - 3)\)\ x\^\(n + 1\)\ b\_\(n + 3\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell["eqs2=SumSplit[eqs2,1]//SumSimplify", "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ \(b\_0\), "+", \(x\ b\_1\), "-", \(\(3\ b\_1\)\/x\), "-", \(4\ b\_2\), "-", \(3\ x\ b\_3\), "+", FormBox[ TagBox[ RowBox[{ UnderoverscriptBox["\[Sum]", \(n = 1\), InterpretationBox["\[Infinity]", DirectedInfinity[ 1]]], \(x\^\(n + 1\)\ \((2\ k\ \((n + 1)\)\ a\_\(n - 1\) + b\_\(n + 1\) + \((n\^2 + 2\ n - 3)\)\ b\_\(n + 3\))\)\)}], HoldForm], "TraditionalForm"]}], "==", "0"}], TraditionalForm]], "Output"] }, Open ]], Cell["\<\ We now extract an associated equation that expresses the conditions \ on the coefficient of the power series representing our solution. We then use \ SumCoefficient to extract the coefficient of the various powers of x and then \ solve with respect to the \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(eqs3 = SumToTerm[eqs2]\)], "Input"], Cell[BoxData[ \(TraditionalForm \`\((2\ k\ \((n + 1)\)\ a\_\(n - 1\) + b\_\(n + 1\) + \((n\^2 + 2\ n - 3)\)\ b\_\(n + 3\))\)\ x\^\(n + 1\) + b\_1\ x - 3\ b\_3\ x + b\_0 - 4\ b\_2 - \(3\ b\_1\)\/x == 0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \(\(Solve[SumCoefficient[eqs3[\([1]\)], x, \(-1\)] == 0, b\_1]\)[\([1]\)] \), \(\(Solve[SumCoefficient[eqs3[\([1]\)], x, 0] == 0, b\_2]\)[\([1]\)]\), \(\(Solve[SumCoefficient[eqs3[\([1]\)], x, 1] == 0, b\_3]\)[\([1]\)]\), \(\(Solve[SumCoefficient[eqs3[\([1]\)], x, n + 1] == 0, b\_\(n + 3\)]\)[ \([1]\)]\)}], "Input"], Cell[BoxData[ \(TraditionalForm\`{b\_1 \[Rule] 0}\)], "Output"], Cell[BoxData[ \(TraditionalForm\`{b\_2 \[Rule] b\_0\/4}\)], "Output"], Cell[BoxData[ \(TraditionalForm\`{b\_3 \[Rule] b\_1\/3}\)], "Output"], Cell[BoxData[ \(TraditionalForm \`{b\_\(n + 3\) \[Rule] \(\(-2\)\ k\ \((n + 1)\)\ a\_\(n - 1\) - b\_\(n + 1\)\)\/\(n\^2 + 2\ n - 3\)}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\ \(% /. n -> n - 3\)\ /. k -> 1 // Simplify\)\)], "Input"], Cell[BoxData[ \(TraditionalForm \`{b\_n \[Rule] \(-\(\(2\ \((n - 2)\)\ a\_\(n - 4\) + b\_\(n - 2\)\)\/\(\((n - 4)\)\ n \)\)\)}\)], "Output"] }, Open ]] }, Closed]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1152}, {0, 900}}, WindowToolbars->{}, WindowSize->{745, 879}, WindowMargins->{{34, Automatic}, {Automatic, 54}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, StyleDefinitions -> "Classroom.nb"]