Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A simple symbolic expression in Matlab

  1. Aug 2, 2013 #1
    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. jcsd
  3. Aug 3, 2013 #2
    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"
     
  4. Aug 6, 2013 #3

    Pythagorean

    User Avatar
    Gold Member

    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.
     
  5. Aug 6, 2013 #4
  6. Aug 6, 2013 #5

    Pythagorean

    User Avatar
    Gold Member

    Ah, I see; he's analyzing the truthiness, not looking for a solution.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: A simple symbolic expression in Matlab
Loading...