Search code examples
matlabsymbolic-mathequation-solving

How can I solve an implicit equation without the symbolic toolbox?


I have an equation like this:

(5+x)^2/15+(x-4)^2/10=100

Can MATLAB solve this equation directly, without having access to the symbolic toolbox? If it can not do this, how can I resolve this problem?


Solution

  • It's possible, but requires some hand work.

    Your function is a polynomial:

    x^2/6 - (2*x)/15 + 49/15 = 100
    

    When pulling the 100 to the left hand side, we can find the roots:

    roots([1/6 -2/15 -1451/15])
    ans =
       24.4948
      -23.6948
    

    where the argument is specified as the prefactors in decreasing order of power.

    Code with which I found the polynomial (requires the Symbolic Math toolbox):

    syms x
    fun = (5+x)^2/15+(x-4)^2/10-100;
    f = simplify(fun);