# How to read this code?

In sage, I performed the laplace transformation:

de=diff(y,t,2)-diff(y,x,2)==k*sin(pi*x);de.laplace(t,s)


and got such a code:

s^2L(y(x,t),t,s)-D[0](y)(x,t)2D[0,0]L(y(x,t),t,s)?sy(x,0)?D[0]L(y(x,t),t,s)D[0,0](y)(x,t)?D[1](y)(x,0)=sksin(?x)


Can someone tells me what D[0](y)(x,t)2D[0,0]L(y(x,t),t,s) and D[0]L(y(x,t),t,s)D[0,0](y)(x,t) mean?
Thanks!

edit retag close merge delete

Sort by ยป oldest newest most voted

Here is what I get.

var('y t s k')
y=function('y',x,t)
de=diff(y,t,2)-diff(y,x,2)==k*sin(pi*x)
de.laplace(t,s)


gives

s^2*laplace(y(x, t), t, s) - D[0](y)(x, t)^2*D[0, 0](laplace)(y(x, t), t, s) - s*y(x, 0) - D[0](laplace)(y(x, t), t, s)*D[0, 0](y)(x, t) - D[1](y)(x, 0) == k*sin(pi*x)/s


Within this expression, the meanings are:

$\frac{\partial y}{\partial t}$ = D[1](y)(x, t)

$\frac{\partial y}{\partial x}$ = D[0](y)(x, t)

$\frac{\partial^2 y}{\partial t^2}$ = D[1, 1](y)(x, t)

$\frac{\partial^2 y}{\partial x^2}$ = D[0, 0](y)(x, t)

So, D[0](y)(0, x) is $\frac{\partial y}{\partial t}|_{t=0}$.

You can check the first one above by doing diff(y,t).

more

But,shouldn't it be :s^2*L(y(t,x),t,s)-s*y(0,x)-D[0](y)(0,x)-D[1,1]L(y(t,x),t,s). on the left side?

( 2012-08-18 03:24:47 +0200 )edit

If you scroll over to the right, I think it's all there.

( 2012-08-18 08:43:21 +0200 )edit

I think they are different between -D[0](Laplace)(y(t,x),t,s)*D[1,1](y)(t,x)-D[0,0](laplace)(y(t,x),t,s)*D[1](y)(t,x)^2 and -D[1,1]L(y(t,x),t,s).

( 2012-08-19 02:53:54 +0200 )edit

I changed my answer above to so that we have y(x,t) like your question, rather than y(t,x).

( 2012-08-19 08:58:21 +0200 )edit

I got it. Thanks!

( 2012-08-19 09:59:47 +0200 )edit

What you're seeing is the displayed notation for symbolic partial derivatives. D[0] means "apply the derivative operator with respect to variable number 0" and D[0,0] represents two successive derivatives with respect to the variable. Observe:

sage: f = function('f', x)
sage: f.diff(x)
D[0](f)(x)
sage: f.diff(x).diff(x)
D[0, 0](f)(x)

more