gfun[diffeqtohomdiffeq] - make a differential equation homogeneous
gfun[rectohomrec] - make a recurrence homogeneous
Calling Sequence
diffeqtohomdiffeq(deq,y(z), <operator=name>)
rectohomrec(rec,u(n), <operator=name>)
Parameters
deq - linear differential equation in y(z) with polynomial coefficients
rec - linear recurrence with polynomial coefficients
y,z - function and variable of the differential equation
u,n - variable and index of the recurrence
operator - (optional) name used verbatim as the differential or shift operator
Description
- If
deqis not homogeneous, thendiffeqtohomdiffeqproduces a differential equation of order increased by one which is homogeneous and cancels all the solutions of the original equation. Ifdeqis homogeneous, it is unchanged. - If
recis not homogeneous, thenrectohomrecproduces a recurrence of order increased by one which is homogeneous and cancels all the solutions of the original equation. Ifrecis homogeneous, it is unchanged. - With
operator=name, initial conditions are not computed and the homogeneous result is returned as a polynomial in the supplied name.
Examples
> with(gfun):
deq:=diff(y(x),x)*(x-1)+2*y(x)-2*x-3:
diffeqtohomdiffeq(deq,y(x));
\[4 y \! \left(x \right)+\left(-4 x -11\right) \left(\frac{d}{d x}y \! \left(x \right)\right)+\left(-2 x^{2}-x +3\right) \left(\frac{d^{2}}{d x^{2}}y \! \left(x \right)\right)\]
> diffeqtohomdiffeq({deq,y(0)=2},y(x));
\[\{4 y \! \left(x \right)+\left(-4 x -11\right) \left(\frac{d}{d x}y \! \left(x \right)\right)+\left(-2 x^{2}-x +3\right) \left(\frac{d^{2}}{d x^{2}}y \! \left(x \right)\right), y \! \left(0\right) = 2, D\! \left(y \right)\! \left(0\right) = 1\}\]
> rec:=u(n+1)=u(n)+n^2+1:
rectohomrec(rec,u(n));
\[\left(-n^{2}-2 n -2\right) u \! \left(n \right)+\left(2 n^{2}+2 n +3\right) u \! \left(n +1\right)+\left(-n^{2}-1\right) u \! \left(n +2\right)\]
> rectohomrec({rec,u(0)=1},u(n));
\[\{\left(-n^{2}-2 n -2\right) u \! \left(n \right)+\left(2 n^{2}+2 n +3\right) u \! \left(n +1\right)+\left(-n^{2}-1\right) u \! \left(n +2\right), u \! \left(0\right) = 1, u \! \left(1\right) = 2\}\]