# Tangent to a 2D graph: tangent

### 7.7.5 Tangent to a 2D graph: tangent

The tangent command draws tangents to surfaces.

- tangent takes two arguments:
  - S, the graph of a two-variable function or a geometric object (see chapter 14).
  - A, a point on S or a number (if S is a graph).
- tangent(S,A) draws tangent(s) to S passing through A.

#### Example.

Define the function g:
Input:

g(x):=x^2

then the graph G of g and a point A on the graph:
Input:

G:=plotfunc(g(x),x):;
A:=point(1.2,g(1.2)):;

If you want to draw the tangent at the point A to the graph G, you can enter:
Input:

T:=tangent(G, A)

or:

T:=tangent(G, 1.2)

Output:

For the equation of the tangent line, you can enter:
Input:

equation(T)

Output:

y=2.4 x−1.44