Is there a way to do implicit differentiation on KhiCAS? Prototypical example:

I have dy/dx = x-y^2 and I would like KhiCAS to tell me that d^2y/dx^2 = 1-2y*(dy/dx).
diff(x-y(x)^2,x)
You will have to replace dy/dx by x-y^2 by hand.
implicitdiff in Xcas does more, but it's not yet in the Casio port.
I see. I managed to figure it out, thank you for your help. Furthermore, is it possible to compute the n'th derivative of a function? I know it is possible it returns an input if n itself is part of the function i.e diff(n*e^x, x, n) will work (incorrectly), but diff(e^(2x), x, n) (which should return (2^n)e^(2x)) will not. Is there a workaround where I possibly define n first?

It seems an inefficient, but still a working method is to use finite differences, see an explicit formula here: https://www.reddit.com/r/math/comments/1cv1ius/formula_for_the_nth_derivative/

Thanks!
N:=5; diff(exp(2x),x,N) will correctly return 32*exp(2*x), and this is also the case for every positive integer N that has a defined value.
It is not possible to compute the N-th derivative of a generic expression if N is symbolic. There are exceptions of course, exp(2x) is one of them, sin(x) would also, but it's only possible for very simple examples like that. Think of an expression like exp(sin(x)) or 1/(1+exp(x^2))
Finite differences methods can not be used to compute a symbolic derivative, only approximations (if all parameters have fixed values).
I have to use KhiCAS50 on my Casio FX-CG50, but I faced with some strange diff equation solve result (simple oscillator diff equation).
desolve(x''=-k*x/m, t, x)
returns
c_0*exp(sqrt(-k*m)/m*t)+c_1*exp(...) but this result is wrong, cause the right result should be with complex numbers something like this:

c_0*exp(-i*sqrt(k*m)*t)+c_1*exp(i*sqrt(k*m)*t)

Could anybody tell me why it so?
sqrt(-k*m) is equal to i*sqrt(k*m). The CAS does not know that your parameters k and m are positive, so it chooses the simplest form for the sqrt.
Run assume(k>0) and assume(m>0) to get desolve answer in terms of cos and sin.
assume is easily accessed from VARS key, > from shift INS
Hi there,

I'm trying to compare results of desolve() of KhiCAS on my FX-CG50 and HP Prime G2.
KhiCAS solves next diff. equation:
desolve(y''=-(k^2)*y, x, y) return c_0*cos(k*x)-c_1*sin(k*x), but this result is wrong, cause the real result is (on HP Prime G2): c_0*e^(-i*k*x)+c_1*e^(i*k*x), and this is the same in cos/sin form: (c_0+c_1)*cos(k*x)+(c_1-c_0)*sin(k*x)*i.
sin in the last expression is imaginary part of the result, but KhiCAS return the real sin without imaginary i.

What I'm doing wrong?
How to solve this diff. equation to see result in imaginary and real parts?
This is the same general solution, but with different constants c_0 and c_1. In linear algebra wording, this is a change of basis, you can choose (x->cos(k*x),x->sin(k*x)) as basis of solutions or (x->exp(i*k*x),x->exp(-i*k*x)) as basis of solutions. The real basis is often prefered, because you can solve with initial conditions without introducing complex numbers.
parisse wrote:
This is the same general solution, but with different constants c_0 and c_1. In linear algebra wording, this is a change of basis, you can choose (x->cos(k*x),x->sin(k*x)) as basis of solutions or (x->exp(i*k*x),x->exp(-i*k*x)) as basis of solutions. The real basis is often prefered, because you can solve with initial conditions without introducing complex numbers.


Thanks a lot, I figured out the solution, in my case it was just necessary to write assume(k, complex) before solving the equation. In my naivety, I assumed that this was done by default))
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 5 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement