# A simple symbolic expression in Matlab

1. Aug 2, 2013

### Dr_Pill

I tried to check

x²-1 = (x+1)(x--1)

So I did the following:

Matlab returns 0.

Any suggestions? :)

(Matlab beginner by the way)

2. Aug 3, 2013

### Bill Simpson

Maybe this? From

http://www.mathworks.com/help/symbolic/logical.html

"Do not use logical to check equations and inequalities that require simplification or mathematical transformations. For such equations and inequalities, logical might return unexpected results. For example, logical does not recognize mathematical equivalence of these expressions:
...
To test the validity of equations and inequalities that require simplification or mathematical transformations, use isAlways:

isAlways(sin(x)/cos(x) == tan(x))
ans = 1"

3. Aug 6, 2013

### Pythagorean

If I'm interpreting the result correctly,
0 is a legit answer, if x = 0, f = -1 and g= -1, so f=g.

Never used the symbolic toolbox, just thought I'd point that out.

4. Aug 6, 2013

5. Aug 6, 2013

### Pythagorean

Ah, I see; he's analyzing the truthiness, not looking for a solution.