this feature named CAS(Computer Algebra System)
this calculator(fx-5800p) don't have this feature
you can buy fx-9860G or GII and download one of below addin and install it:
1-http://www.casiocalc.org/?showtopic=3632
2-http://cas.jeuxcasio.com/en/
number 1 have a lot of bug but number 2 is very good and i think now is best
if you have more money you can buy Algebra Fx2.0 Plus
this calculator have CAS but with little symbolic function
(it can expand equation like (x+1)(x+2) to x^2+3x+2)
if you have a lot of money you can buy classpad
this calculator have CAS with a lot of symbolic function
some of functions:
approx,simplify,expand,factor,rFactor,factorout,combine,collect,tExpand
,tCollect,expToTrig,trigToExp,taylor,laplace,invlaplace,fourier,invFourier
,FFT,IFFT,diff,impdiff,indefinite integral,symbolic matrix
if you need more help you can download handheld of above product from
http://edu.casio.com/