How to use Wolframalpha to verify the solution to a DE?

705 Views Asked by At

I would like to find the correct syntax for Wolframalpha so that it will test my solution to a DE. e.g. if I find that $y_p = -t^2 + \frac{3}{2}t - \frac{11}{8}$ and would like to see what that yields when I take $y'' - 3y' -4y$, how could I input this?

I've found the page that will solve DEs for me, but I want to do the work myself and simply find a faster way to verify that my particular form is correct. So far, the only solution I've found is to input $D(Dy) - 3Dy -4y$ where $y = y_p$ and, if I'm lucky, it will provide a simplified form. Any thoughts?

1

There are 1 best solutions below

1
On BEST ANSWER

Paste this into Wolfram Alpha:

Simplify (D[#, t, t] - 3D[#, t] - 4#)& @ (-t^2 - 3t/2 - 11/8 )

The above has the form of $O(y)$ where operator $O$ is defined as $d^2/dt^2 - 3d/dt -4$ which operates on (via the @-sign) the polynomial $-t^2 - 3t/2 - 11/8 $.

To define a function or an operator, use # as the variable and terminate the definition with &. For example, $m x + b$ becomes (m# + b)&. It's what is called a pure function. A better name may be anonymous function.

To define a differential operator, use the derivative operator, which is just a capital D. For example D[#,x,y]& is a pure function that calculates the second partial w.r.t. x and then y. You could use it like this

D[#,x,y]& @ ( x y z - y^2 + z^2 )

Notice the use of square brackets to indicate the argument of the D function. Notice that I don't use * for multiplication, but you can if you want to. I like to use parentheses, but you may be able to get away without using them.

Sometimes it helps to put the word "simplify" in front of your expression, so Wolfram Alpha knows what to do with it.

So, back at the top line, we see the & at the end of the pure function. We see the # sign three places, where the argument of the pure function will be substituted. We see the @-sign that says to evaluate the pure function "at" the following expression, which is a polynomial in this example and is in parentheses, in this example.

There may be better ways to do this. The only reason I am using a pure function is that it allows me to insert a complicated argument into each term of the differential operator.