# HP Forums

You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Has anyone been able to figure out the proper syntax for the desolve() command? I have tried everything I can think of, and each time receive an error message "Error: Bad Argument Value"

Very simple example problem: y' = 2x + 4
Solution: y = x^2 + 4x + C

However, desolve(y'=2x + 4, x, y) as well as desolve(y'=2x+4, y) both give the "Bad Argument Value" error message. In fact, so do the examples from the "Help" system, when I use the "Exampl" key to copy them into the command line to try them.

Thanks.
Check that x or/and y are purged.
desolve(eqdiff) should work, you can omit x and y (the variables are required if they are not the default).
When I do this without spaces it seems to work ok.

desolve(y'=x^2+4,x,y) evaluated to:
desolve(diff(y)=x^2+4,x,y)

returns:

(3G_0+x^3+12x)/3

I'm not sure if that's right or not... but there ya go.
(09-04-2015 06:22 PM)ewjax Wrote: [ -> ]Has anyone been able to figure out the proper syntax for the desolve() command? I have tried everything I can think of, and each time receive an error message "Error: Bad Argument Value"

Very simple example problem: y' = 2x + 4
Solution: y = x^2 + 4x + C

However, desolve(y'=2x + 4, x, y) as well as desolve(y'=2x+4, y) both give the "Bad Argument Value" error message. In fact, so do the examples from the "Help" system, when I use the "Exampl" key to copy them into the command line to try them.

Thanks.

Your example is a simple derivative, in order to get the result you have just to integrate ;-)
Thanks for responses. The clearing/purging of existing variables seemed to do the trick. As an aside - that seems disconcerting that I have to remember to purge all variables prior to using the solver...

I also learned I am only able to make it work by using the y' form of differential - the dy/dx template does not seem to work (yields "undef" message).
Finally was able to solve the problem I started out working on. This only took me 48 hours to figure out...(my son is taking a DiffEq course, it's only been 3 decades since I took mine so my skills are, uh, rusty. They are solving this thing manually and I just wanted to confirm the final answer using my shiny new HP Prime. A mere 48 hours later, after a shocking lack of info from google, I finally have my answer, and thought I might share what I learned for the next google-starved victim researching this same question.)

Differential equation: y' - 2y = xe^x
Boundary condition: y(0) = 1

You must ensure nothing is stored in x or y. Mem (shift toolbox), highlight "User Variables", backspace will allow you to clear them all. Thanks for that advice to the user above, that was the enabling step. Once that is done:

Keystrokes:
Code:
``` CAS Toolbox / CAS / Solve / Differential Equation (results in desolve() on command line)```

Now key in the differential equation and boundary condition in a [] vector, followed by the dependent variable y after the vector. The Help example accomplishes the same thing with AND statements rather than the [] vector, but I find the vector method more elegant.

Code:
``` desolve([y'-2y=x*e^x  y(0)=1],y) enter```

results in
Code:
``` -x*e^x - e^x + 2*e^(2*x)```

Items of note:
- near as I can tell, you cannot use the dy/dx template, you must enter the differential in y' form. Disappointing.
- you must explicitly put the multiplication star between x and e^x, otherwise it thinks you've created a new variable xe and won't implicitly insert the multiplication
- as mentioned, for some reason the variables x and y cannot have anything previously stored in them. I find this puzzling but it seems to be important, so...
(09-04-2015 09:11 PM)ewjax Wrote: [ -> ]Thanks for responses. The clearing/purging of existing variables seemed to do the trick. As an aside - that seems disconcerting that I have to remember to purge all variables prior to using the solver...

I also learned I am only able to make it work by using the y' form of differential - the dy/dx template does not seem to work (yields "undef" message).

If you want to do numerical calculations, do them in the home screen where you need to assign values to the variables for the function to evaluate. Assigning a value to X in the home screen will not affect the variable x in the CAS. I've run into that issue as well, and I've found this approach works. If you insist on assigning values to variables in the CAS, get in the habit of clearing the variable immediately after evaluation. vars -> CAS -> All -> highlight the var and hit the del key.
(09-04-2015 11:31 PM)pwarmuth Wrote: [ -> ]If you want to do numerical calculations, do them in the home screen where you need to assign values to the variables for the function to evaluate. Assigning a value to X in the home screen will not affect the variable x in the CAS. I've run into that issue as well, and I've found this approach works. If you insist on assigning values to variables in the CAS, get in the habit of clearing the variable immediately after evaluation. vars -> CAS -> All -> highlight the var and hit the del key.