Intersection of a 2D graph with the axis

### 19.3.7 Intersection of a 2D graph with the axis

You can find the intersection of the graph y=f(x) of a function with the axes using the commands covered so far.

- Finding the intersection of the graph with the y-axis is simply evaluating

  f(0),

  indeed the point with coordinates (0,f(0)) is the intersection point of the graph of f with the y-axis.
- Finding the intersection of the graph of f with the x-axis requires solving the equation f(x)=0.
  - If f(x) is polynomial-like, then you can find the the exact values of the abscissa of these points with solve (see Section 9.3.6).

    solve(f(x),x)

    returns the solution.
  - Otherwise, you can find numeric approximations of these abscissa. First, look at the graph for an initial guess x0 or a range with an intersection and then refine it with fsolve (see Section 23.3.2).

    fsolve(f(x),x,x0,method) returns a numeric approximation of a solution.