# How to use Wolframalpha to verify the solution to a DE? [closed]

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?

## closed as off-topic by Zach466920, user137731, user147263, Claude Leibovici, rogerlOct 31 '15 at 14:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is not about mathematics, within the scope defined in the help center." – Community, Community, Claude Leibovici, rogerl
If this question can be reworded to fit the rules in the help center, please edit the question.

• I don't mean to be demeaning, but taking the derivative of a polynomial isn't very difficult, can you not verify by hand? Also you'd ask for wolfram to take the appropriate derivatives. – Zach466920 Oct 30 '15 at 22:06
• Copy and paste is not that hard for plugging in the $y_p$'s. – user137731 Oct 30 '15 at 22:09
• @Zach466920 I wrote "e.g." for a reason - simply to clarify the objective. I don't mean to be demeaning, but paying attention to the question and not conflating it with an example isn't very difficult ;D – Rax Adaam Oct 30 '15 at 22:41
• @Bye_World what do you write for higher order derivatives? any work around to having to nest D(D(D(D(....)))) ? when I tried d^2/dt^2, it interpreted "d" as days... – Rax Adaam Oct 30 '15 at 22:42
• @RaxAdaam Can you not type find nth derivative of $f(x)$? Also, perhaps I feel that not having a real example makes answering the question pointless... – Zach466920 Oct 30 '15 at 22:44

## 1 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.

• thank you very much - this is exactly what I had hoped to find and know it would've taken me a very long time in any reference. Apologies to the rest of the site - I did not realize there was an exception on syntax questions for Mathematica. I will be sure to post future syntax questions there. All the best - – Rax Adaam Nov 1 '15 at 1:03