MATLAB Answers

Jay Lee
0

Find all points of intersection between two functions

Asked by Jay Lee
on 17 Feb 2019
Latest activity Answered by Star Strider
on 17 Feb 2019
syms x
ezplot(@(x)x^6 ,[-10,10,-10,10])
hold on
ezplot(@(x)3^x ,[-10,10,-10,10])
hold off
I have functions f(x) = x^6 and g(x) = 3^x. I made the graph of two functions, but is there any ways that I can find all points of intersection between two functions?

  0 Comments

Sign in to comment.

1 Answer

Answer by Star Strider
on 17 Feb 2019

There are only 2 real intersection points. To find them, you simply need to find out the x-values where the functions equal each other, or equivalently where the difference between them is 0:
intsx = solve(x^6 == 3^x , x)
or:
intsx = solve(x^6 - 3^x == 0 , x)
then:
intsxn = vpa(intsx)
giving the 2 real roots:
intsxn =
1.2593399329995780507387959662256
-0.8550750819209264565809050645918
and 4 complex roots.

  0 Comments

Sign in to comment.