Ask Your Question

Revision history [back]

Take for example that $\hat A = a \frac{d^2}{dx^2}, a>0$ which leads to the eigenvalue equation $$\hat A f(x) = b f(x) \iff af''(x) = bf(x)$$ (I assume for simplicity that $b<0$). Using desolve_laplace I define g(x) as the solution to the equation. Then I am not able to substitute the solution to my original equation

Code: sage: x,a,b = var('x,a,b') sage: f = function('f',x) sage: g = function('g',x) sage: assume(a>0); assume(b<0) sage: eqn = a*diff(f,x,2) == b*f(x) sage: g(x) = desolve_laplace(eqn, f, ivar=x) sage: g x |--> (a^2sin(sqrt(-ab)x/a)D0(0)/sqrt(-ab) + acos(sqrt(-ab)x/a)f(0))/a sage: eqn.substitute_function(f,g) aD0, 0(x) == bf(x) sage: eqn.substitute_expression(f(x) == g(x)) aD0, 0(x) == (a^2sin(sqrt(-ab)x/a)D0(0)/sqrt(-ab) + acos(sqrt(-ab)x/a)f(0))b/a

Am I clear?

Take for example that $\hat A = a \frac{d^2}{dx^2}, a>0$ which leads to the eigenvalue equation $$\hat A f(x) = b f(x) \iff af''(x) = bf(x)$$ (I assume for simplicity that $b<0$). Using desolve_laplace I define g(x) as the solution to the equation. Then I am not able to substitute the solution to my original equation

Code: Code:

sage: x,a,b = var('x,a,b')
sage: f = function('f',x)
sage: g = function('g',x)
sage: assume(a>0); assume(b<0)
sage: eqn = a*diff(f,x,2) == b*f(x) 
sage: g(x) = desolve_laplace(eqn, f, ivar=x)
sage: g
x |--> (a^2sin(sqrt(-ab)x/a)D0(0)/sqrt(-ab) (a^2*sin(sqrt(-a*b)*x/a)*D[0](f)(0)/sqrt(-a*b) + acos(sqrt(-ab)x/a)f(0))/a
a*cos(sqrt(-a*b)*x/a)*f(0))/a
sage: eqn.substitute_function(f,g)
aD0, 0(x) a*D[0, 0](f)(x) == bf(x)
b*f(x)
sage: eqn.substitute_expression(f(x) == g(x))
aD0, 0(x) a*D[0, 0](f)(x) == (a^2sin(sqrt(-ab)x/a)D0(0)/sqrt(-ab) (a^2*sin(sqrt(-a*b)*x/a)*D[0](f)(0)/sqrt(-a*b) + acos(sqrt(-ab)x/a)f(0))b/a

a*cos(sqrt(-a*b)*x/a)*f(0))*b/a

Am I clear?