Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking symbolic computations

I have to do some computations where long formulae, mainly involving derivatives of polynomials with variable coefficients come up.

Unfortunately the results I obtain from engines like Mathematica or Maple are represented in a way that is very different to those I need, and rearranging the result into the desirable form takes too long (not to mention the risk of re-introducing errors).

Hence I was wondering whether there is some way to instead do the computations myself and then let the result be checked – i.e. some sort of "equation checker":

I put in d/dx f(x) = g(x) where I provide BOTH sides and the system evaluates this to be true or false.

like image 830
harlekin Avatar asked May 08 '26 02:05

harlekin


1 Answers

I would check out sym/isequaln. It is an overloaded version of isequaln used to compare symbolic expressions. For example:

syms x
f(x) = 3*x^3-2*ln(x);
g(x) = 9*x^2 - 2/x;
isequaln(f,g)

ans =
    0

isequaln(diff(f), g)

ans = 
    1

See the MathWorks documentation on the function. It's pretty handy.

like image 110
zachd1_618 Avatar answered May 09 '26 16:05

zachd1_618



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!