Graph of a Function
Nerd Cafe
1. What is a Graph of a Function?
A graph of a function is the visual representation of all ordered pairs (x, f(x)). It gives us insight into the function’s behavior, such as:
Where it increases or decreases
Its symmetry
Maximum or minimum points
Intercepts and asymptotes
A function maps every input x to a unique output f(x). Plotting this for various x-values results in a curve or line.
2. Basic Example
Let’s consider:
To graph this, we compute several (x, f(x)) values:
-3
9
-2
4
-1
1
0
0
1
1
2
4
3
9
Plotting these points gives a parabola opening upwards.
3. Key Features of a Graph
When analyzing graphs, observe:
Domain
All x-values for which f(x) is defined
Range
All possible f(x) values
x-intercepts
Where the graph crosses the x-axis (f(x) = 0)
y-intercept
Where the graph crosses the y-axis (x = 0)
Asymptotes
Lines that the graph approaches but never touches
Symmetry
Even/Odd/None
Increasing/Decreasing Intervals
Where the graph goes up/down
Maximum/Minimum
Peaks and valleys of the graph
4. Python Example: Plotting a Function
Example 1: Plotting 𝑓(𝑥)=x2
Let’s use matplotlib
and numpy
to graph a function.
Output:
You can also plot using sympy
.
Output:
Example 2: 𝑓(𝑥)=sin(x)
Let’s use matplotlib
and numpy
to graph a function.
Output:
You can also plot using sympy
.
Output:
5. Try Multiple Graphs Together
Let’s use matplotlib
and numpy
to graph a function.
Output:
You can also plot using sympy
.
Output:
Keywords
symbolic math
, sympy
, sine function
, sin(x)
, plot sin
, symbolic plotting
, python math
, calculus
, symbolic computing
, algebra
, trigonometry
, math visualization
, pure sympy
, no numpy
, no matplotlib
, math graph
, function plot
, symbolic expression
, math function
, sympy plot
, nerd cafe
Last updated