If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Example: Graphing y=3⋅sin(½⋅x)-2

Sal graphs y=3⋅sin(½⋅x)-2 by thinking about the graph of y=sin(x) and analyzing how the graph (including the midline, amplitude, and period) changes as we perform function transformations to get from y=sin(x) to y=3⋅sin(½⋅x)-2. Created by Sal Khan.

Want to join the conversation?

  • purple pi pink style avatar for user Jenna Kim
    For the practice problems, I don't understand why for some of the graphs, the extremun's x-coordinate is 0, and for other graphs, the midline's x-coordinate is 0.
    (15 votes)
    Default Khan Academy avatar avatar for user
    • purple pi pink style avatar for user Jenna Kim
      Oh, I figured it out! If it’s cos - the extremum point’s x-coordinate is c, and the y-coordinate is a + d. The midpoint’s x-coordinate is 2pi divided by b, then that whole thing divided by 4, and the y coordinate is d.
      If it’s sin - the midpoint’s x-coordinate is c, and the y-coordinate is d. The extremum’s x-coordinate is 2pi divided by b, then that whole thing divided by 4, and the y-coordinate is a + d.

      basically:

      sine
      extremum point : ((c), (a+d))
      midpoint : (((2pi / b)/4), (d))

      cosine
      extremum point : (((2pi / b)/4), (a+d))
      midpoint : ((c), (d))
      (25 votes)
  • leaf green style avatar for user Sally
    Hi, I know Sal mentioned that sin(0) is always 0, sin(pi/4) is always sqrt(2)/2.
    Is that the case for all equations OR is it just for unit circles?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Ash_001
      It is only for unit circles, this is true because the side ratios of special right triangles are as follows -

      30-60-90 ---> side opp to 30 is x
      side opp to 60 is (root 3)*x
      side opp to 90 is 2x

      45-45-90 ---> side opp to 45 is x
      side opp to 90 is (root 2)*x

      In the case of the unit circle it is (root 3)/2 because the 2x (side opp to 90 in 30-60-90 triangle) in the case of that triangle is 1 (is a unit circle and the hyp is the radius) and therefore x = 1/2 using simple algebra. The other side is (root 3)*x and since x = 1/2, that simplifies to (root 3)/2. If the hyp of the triangle was not = 1 (means the circle is not a unit circle) then this would not work. This is why it is only for a unit circle.
      Hope this was helpful!
      (7 votes)
  • blobby green style avatar for user belgibekovm
    this topic is really daunting. it does not have apparent formulas for solving something. and you always have to watch videos. i wish there were some text like lessons where all formulas are written clearly.
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user cossine
      Read the following:

      Explanation of trig curve sketching

      Question: How to sketch Cos(2x-pi/3)

      There two transformations going on, the horizontal stretch and the phase shift (i.e. horizontal shift).

      To stretch a function horizontally by factor of n the transformation is just f(x/n).

      So let f(x) = cos(x)

      => f(x/(1/2)) = cos(x /(1/2) ) = cos(2x)

      So the horizontal stretch is by factor of 1/2.

      Since the horizontal stretch is affecting the phase shift pi/3 the actual phase shift is pi/6 to the right as the horizontal stretch is 1/2.

      cos(2x-pi/3) = cos(2(x-pi/6))

      Let say you now want to sketch cos(-2x+pi/3). Remember that cos theta is even function. A function is even if f(-x) = f(x). Substitute u = 2x-pi/3 =>
      cos(-2x+pi/3) = cos(-u) = cos(u) = cos(2x-pi/3)

      Similarly you can sketch sin(2x-pi/3) the same way just beware sin is an odd function not an even function. Note a function is odd if f(-x) = -f(x).

      If you wanted to sketch an equation tan theta remember that period of tan theta is pi and tan is an odd function.

      Basic notes

      Midline:
      Vertical shift is just d. This result in the midline y=d.

      Amplitude:
      The amplitude is the maximum distance from the midline. i.e. amplitude = |a|. The || (absolute value function) makes everything that is negative become positive. As 'a' can be negative we take the absolute value to make sure it is positive. e.g. |-6| = 6, |-pi| = pi, |-2.78| = 2.78. Note that anything that is positive remains positive i.e. |4| = 4, |6| = 6, |pi| = pi. The reason for the absolute value is we are interested in the distance from the midline which is non-negative.

      Period:
      Note when equation is in the form asin(bx+c) + d the period is just 2pi/|b|. While the period was originally 2pi, the period has been altered by the horizontal stretch. The formula 2pi/|b| for the period might be easier to use than thinking of horizontal stretches.

      Note the period of a function f is the smallest positive value of x* such that f(x) = f(x+x*). Note that for all x, sin(x) =sin(x+2pi). In this case x* is 2pi.

      Note it might to help to learn about curve sketching for more detail on things discussed.

      If yo ever want to experiment with graphing trigonometric function you can use desmos. https://www.desmos.com/calculator
      (5 votes)
  • mr pants pink style avatar for user Jay Mack
    Why when you have an equation, if you have a coefficient on one side do you have to distribute that to the other side, but also making sure you distribute it to the entire expression on the other side
    (2 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      I am not sure how this question relates to the video, it sounds like you are asking something more like 4x+3y=6. To get this in slope intercept form, subtract 4x to get 3y=-4x+6. To get rid of the coefficient of 3, we have to divide ALL TERMS by 3 to get 3/3y = 4/3 x + 6/3 or y=4/3x + 2. If you do not divide all terms on the other side, you will not get an equivalent equation. Example: suppose you say 10 = 6 + 4. If I divide by 2 (and do not divide all terms on right by 2) I might get 5 = 3+4 or 5=6+2, neither of which is correct. If I divide all terms by 2, I get 5 = 3+2 which is correct.
      (5 votes)
  • blobby green style avatar for user ryanpowersoh
    I don't understand why Sal says that the Sin of (1/2)pi = 1 but then graphs the point at (pi, 1). Shouldn't the coordinates be (1/2pi, 1)?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Vortex7
      Assuming you mean around , what Sal is saying is that if you are at x=π, you can test for what the y value is by plugging π in for x in the equation (but right then he's ignoring the 3 and -2). This makes (1/2)π, and the sin of that is 1. So at x=π, y=1.
      (5 votes)
  • leaf blue style avatar for user 3010998
    So I have been doing some textbook problems related to this, and how come I have never encountered a problem in which b is negative? Is there a reason why this is the case?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Akira
    How to derive period = 2pi/k?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Andrzej Olsen
      Let's look at sin(x), thinking about the unit circle definition. We complete a full cycle after we have rotated 2π radians, so the period of sin(x) is 2π.

      In sin(kx), we go k times as fast as in sin(x). We can even imagine the unit circle as a racetrack, with x as time, sin(kx) as the y position of the car, and k as the speed of the car. How much time will it take for the car to go around the track once?

      We already know that when k=1, the period is 2π. We can also use this:

      speed = distance/time

      We already talked about the speed being k. The period should just be the time elapsed when the car completes one lap. So, let's plug in speed = 1 and time = 2π, seeing what we get for distance.

      1 = distance/2π
      2π = distance

      This makes sense, considering there are 2π radians in a circle. When we plug in k and period as we always have, we get this equation:

      speed = 2π/time
      k = 2π/period

      If we multiply period and divide k on both sides, we end up with our final answer.

      period = 2π/k
      (2 votes)
  • leaf blue style avatar for user Gabriel
    In what video is explained how the period can be calculated by dividing 2pi by the coeficient?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Bruh Monkey
    I understand how to graph a sin function when the x-axis uses increments of pi, but how do you create a basic sin function like Sal does at when the x-axis uses increments of 1, like in some of the questions in the next practice section?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • duskpin ultimate style avatar for user Ash_001
      Know that Period = 2pi/B
      When the sin function is in the form A*sin(Bx) + C
      If your "B" has pi in it, the pi will cancel from the numerator and denominator and give you a result that is NOT in the increments of pi, But when "b" is just a random number, you will get it in terms of pi.
      Hope this helped!
      (2 votes)
  • male robot donald style avatar for user 270629
    How did he know about what the basic shape of the graph looks like?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • primosaur ultimate style avatar for user Aristotle
      Using a unit circle and your knowledge of terminal sides (cos(x), sin(y)). You must.... understand terminal sides and unit circles. I've left an explanation in the unit circle video explaining terminal sides.

      So as you go counterclockwise in a unit circle, what happens to the sin(x) or cos(x). For example, at 90 degrees(pi/2), counterclockwise, what values do cosine equal? It would be (0,1), cosine would be equal to 0. What would sine be equal to? (0,1) sine would be equal to 1.

      Now you go around the unit circle, find the values that go with each 90 degrees. 90,180,270,360 and the cosine/sine values for every part of that rotation. Then you will have them in pi form and value form. Now you can plot them and see what it looks like for sine or cosine graphs. When you plot them make sure to use pi form on the x-axis and sine form on the y axis.

      For example, Sine graph and it's values:
      90(pi/2)- (pi/2, 1)
      180(pi)- (pi, 0)
      270(3pi/2)-(3pi/2, -1)
      360(2pi)-(2pi,0)

      https://www.khanacademy.org/math/algebra2/x2ec2f6f830c9fb89:trig/x2ec2f6f830c9fb89:trig-graphs/v/we-graph-domain-and-range-of-sine-function

      Using this same problem-solving method, you can now do the same thing for cosine graphs.
      For example, Cosine graph and it's values:
      90(pi/2)- (pi/2, 0)
      180(pi)- (pi, -1)
      270(3pi/2)-(3pi/2, 0)
      360(2pi)-(2pi,1)
      https://www.khanacademy.org/math/algebra2/x2ec2f6f830c9fb89:trig/x2ec2f6f830c9fb89:trig-graphs/v/we-graphs-of-sine-and-cosine-functions

      Note: I didn't include the starting point, 0, to explain what you are essentially solving for when you're rotating counterclockwise and finding either the sine or cosine value associated with that part of the rotation on the unit circle.

      The second video will show you all the values for 0 at .
      (2 votes)

Video transcript

- [Instructor] So we're asked to graph y is equal to three times sine of 1/2x minus 2 in the interactive widget. And this is the interactive widget that you would find on Khan Academy. And it first bears mentioning how this widget works. So this point right over here, it helps you define the midline, the thing that you could imagine your sine or cosine function oscillates around, and then you also define a neighboring extreme point, either a maximum or a minimum point to graph your function. So let's think about how we would do this, and like always, I encourage you to pause this video and think about how you would do it yourself. But the first way I like to think about it is what would a regular, just, if this just said y is equal to sine of x, how would I graph that? Well, sine of 0 is 0. Sine of pi over 2 is 1. And then sine of pi is 0, again. And so this is what just regular sine of x would look like. But let's think about how this is different. Well, first of all, it's not just sine of x, it's sine of 1/2x. So what would be the graph of just sine of 1/2x? Well, one way to think about it, there's actually two ways to think about it, is a coefficient right over here on your x term that tells you how fast the thing that's being inputted into sine is growing. And now it's going to grow half as fast. And so one way to think about it is your period is now going to be twice as long. So one way to think about it is instead of getting to this next maximum point at pi over 2, you're going to get there at pi. And you could test that. If you at, when x is equal to pi, this will be 1/2 pi, sine of 1/2 pi, is indeed equal to 1. Another way to think about it is you might be familiar with the formula, although I always like you to think about where these formulas come from, that to figure out the period of a sine or cosine function, you take 2 pi and you divide it by whatever this coefficient is. So 2 pi divided by 1/2 is going to be 4 pi. And you could see the period here, we go up, down, and back to where we were over 4 pi. And that makes sense, because if you just had a 1 coefficient here, your period would be 2 pi, 2 pi radians. You make one circle around the unit circle is one way to think about it. So right here we have the graph of sine of 1/2x. Now what if we wanted to, instead, think about 3 times the graph of sine of 1/2x, or 3 sine 1/2x? Well then our amplitude's just going to be three times as much. And so instead of our maximum point going from, instead of our maximum point being at 1, it will now be at 3. Or another way to think about it is we're going 3 above the midline and 3 below the midline. So this right over here is the graph of 3 sine of 1/2x. Now we have one thing left to do, and this is this minus 2. So this minus 2 is just going to shift everything down by 2. So we just have to shift everything down. So let me shift this one down by 2 and let me shift it this one down by 2. And so there you have it. Notice our period is still 4 pi. Our amplitude, how much we oscillate above or below the midline, is still 3. And now we have this minus 2. Another way to think about it, when x is equal to 0, this whole first term is going to be 0, and y should be equal to negative 2? And we're done.