How to Write the Equation of a Sine Graph
To write a sine equation from a graph, find the midline, amplitude, period, and a midline crossing. Use \(y=A\sin(B(x-h))+D\), where the amplitude is \(|A|\), the period is \(P=2\pi/|B|\), the horizontal shift is \(h\), and the midline is \(y=D\). The parameter \(B\) controls the period; it is not the period itself. These formulas use radians and assume \(A\ne0\), \(B\ne0\).
Quick answer: A sine graph has the equation y = A sin(B(x – h)) + D. A is the amplitude, half the distance from max to min. The period is 2π/B. h is the horizontal shift to an upward midline crossing, and D is the midline. For example, y = 2 sin(3x) + 1 has amplitude 2, period 2π/3 and midline y = 1.
Related Topics
- How to Graph the Sine Function
- How to Graph the Cosine Function
- How to Graph Inverse of the Sine Function
- How to Graph Inverse of the Cosine Function
Step-by-step to write the equation of a sine graph
To find out how to write the equation of a sine graph, follow the step-by-step guide below:
- Amplitude: Read the maximum \(M\) and minimum \(m\). The amplitude is \((M-m)/2\), a nonnegative distance. In the equation it equals \(|A|\), not necessarily \(A\).
- Period: Measure the horizontal distance \(P\) between consecutive peaks, consecutive troughs, or matching crossings in the same direction. Choose \(B=2\pi/P\). For an axis measured in degrees, use \(B=360^\circ/P\) instead.
- Horizontal shift: For positive \(A\) and \(B\), choose \(h\) at a midline crossing where the graph rises. A downward crossing requires a negative \(A\) with this choice of positive \(B\). Equivalent equations may use a different crossing.
- Vertical shift: Set \(D=(M+m)/2\), the height of the midline.
For amplitude \(2\), period \(4\pi\), a right shift of \(3\), and an upward shift of \(1\), choose \(A=2\), \(B=2\pi/(4\pi)=1/2\), \(h=3\), and \(D=1\). A matching equation is \(y=2\sin\left(\frac{x-3}{2}\right)+1\). Check: its period is \(2\pi/(1/2)=4\pi\), its maximum is \(3\), and its minimum is \(-1\).
You can also use a graphing calculator or a software like Desmos to help you graph the function and find the equation.
The parent functions \(y=\sin x\) and \(y=\cos x\) have amplitude \(1\), range \([-1,1]\), period \(2\pi\), and domain all real numbers. Amplitude is a distance; the interval from \(-1\) to \(1\) describes their range.
Worked example: find an equation from key points
Suppose a sinusoidal graph has maximum \(5\), minimum \(-1\), period \(8\), and crosses the midline upward at \(x=2\). Then \(D=(5+(-1))/2=2\), \(A=(5-(-1))/2=3\), \(B=2\pi/8=\pi/4\), and \(h=2\). One equation is \(y=3\sin\left(\frac{\pi}{4}(x-2)\right)+2\).
Check five equally spaced points in one cycle: \((2,2)\), \((4,5)\), \((6,2)\), \((8,-1)\), and \((10,2)\). Their horizontal spacing is \(P/4=2\). These points confirm the upward crossing, maximum, minimum, and return to the starting height and direction.
Need more practice? Trigonometry for Beginners covers Trigonometry step by step, with practice problems and answers. Look inside · $17.99
Check the equation before you finish
Substitute a peak, a trough, and a midline crossing from the graph. Confirm the maximum and minimum, one full repeat length, and whether the graph rises or falls at your chosen crossing. In \(A\sin(Bx-C)+D\), the horizontal shift is \(C/B\); factor out \(B\) before reading the shift.
For the underlying transformation formulas, see OpenStax: Graphs of the Sine and Cosine Functions. Use the related sine and cosine lessons above to compare equivalent representations.
Write the Equation of a Sine Graph: what to notice and how to work it
What to notice first
Common student mistake
Key formulas and cues
A reliable path
- Choose the modelUse a right triangle, the unit circle, or a transformed graph.
- Track unitsConvert degrees and radians when needed.
- Use identitiesReplace complicated trig expressions with equivalent simpler ones.
Worked examples
Read a sine graph rule
- Amplitude is |3|.
- Period is 2pi/2 = pi.
- Midline is y = -1.
Place five key points
- Start at (0, 0).
- Use quarter-period steps: pi/2, pi, 3pi/2, 2pi.
- The y-values are 0, 1, 0, -1, 0.
Try one before moving on
Write the Equation of a Sine Graph: pop-up practice
Reading each value off a sine graph
| Value | What to look for | How to compute it |
|---|---|---|
| D (midline) | The horizontal line halfway between peaks and valleys | D = (max + min) ÷ 2 |
| A (amplitude) | How far the graph rises above the midline | A = (max – min) ÷ 2 |
| Period | Horizontal distance from one peak to the next | Measure it on the x-axis |
| B | How many cycles fit in 2π | B = 2π ÷ period |
| h (phase shift) | An x-value where the graph crosses the midline going up | Read it from the graph |
If the graph crosses the midline going down at your chosen point, keep h at that point and make A negative. If the graph starts at a peak, a cosine equation is often easier: y = A cos(B(x – h)) + D with h at the peak.
Example: a sine graph that starts by going down
A graph has a maximum of 4 and a minimum of -2. It crosses the midline going down at x = 0, and the next downward crossing is at x = π.
- Midline: D = (4 + (-2)) ÷ 2 = 1.
- Amplitude: (4 – (-2)) ÷ 2 = 3.
- Period: π – 0 = π, so B = 2π ÷ π = 2.
- The graph goes down at x = 0, so use A = -3 with no shift.
The equation is y = -3 sin(2x) + 1. Check two points. At x = π/4, y = -3 sin(π/2) + 1 = -2, the minimum. At x = 3π/4, y = -3 sin(3π/2) + 1 = 4, the maximum. Both match. Another correct answer is y = 3 sin(2(x – π/2)) + 1, which uses the upward crossing at x = π/2.
Frequently Asked Questions
What is the equation of a sine graph?
A sine graph follows y = A sin(B(x − h)) + D. The amplitude is |A|, the period is 2π/|B|, h is the horizontal shift and y = D is the midline. For example, y = 4 sin(2(x − 1)) − 3 has amplitude 4, period π, a shift of 1 to the right and midline y = −3.
How do you find B in a sine graph?
Measure the period P, the horizontal distance between two neighboring peaks, then use B = 2π/P. If a graph repeats every 4π, B = 2π/4π = 1/2. If it repeats every π, B = 2. When the x-axis is in degrees, use B = 360°/P instead. Remember that B is not the period itself.
How do you write a sine function from a graph?
Read the max and min, then the period and an upward midline crossing. Suppose the max is 5 and the min is −1: D = (5 + (−1))/2 = 2 and A = (5 − (−1))/2 = 3. If the period is 8, B = 2π/8 = π/4. With an upward crossing at x = 1, the equation is y = 3 sin(π/4 (x − 1)) + 2.
How do you write a sinusoidal function?
A sinusoidal function can use sine or cosine: y = A sin(B(x − h)) + D or y = A cos(B(x − h)) + D. Use sine when you can spot a point where the graph crosses its midline going up, and cosine when you can spot a maximum. Both forms give the same curve with a different horizontal shift.
What is the sine wave graph equation in physics?
In physics a sine wave is often written y = A sin(2πft + φ), where A is the amplitude, f is the frequency in cycles per second and φ is the phase shift. Here B = 2πf, so the period is 1/f. A wave with amplitude 3 and frequency 2 Hz is y = 3 sin(4πt), which repeats every 0.5 seconds.
Related to This Article
More math articles
- Mixed Numbers and Improper Fractions for 4th Grade
- First Great Awakening: Revival, New Lights and Social Limits
- NCLEX Delegation Questions: Right Person vs. Right Direction (2027 Prep)
- The Best Grade 4 Math Book for New Hampshire Students
- Moon Phases, Eclipses, and Tides
- Top 5 Best Math YouTube Channels for High School Students
- Can You Train Your Brain to Think Like a Mathematician?
- Differentiability: Everything You Need To Know
- 8th Grade PARCC Math FREE Sample Practice Questions
- The Best Grade 3 ELA Practice Tests for North Carolina Students



What people say about "Sine Graph Equation: How to Write y = A sin(B(x - h)) + D"?
No one replied yet.