Confusion with modeling a trigonometric function with phase shift I am studying trigonometry on Khan Academy and came across this problem:
The moon's distance from Earth varies in a periodic way that can be modeled by a trigonometric function.
When the moon is at its perigee (closest point to Earth), it's about 363,000 km away. When it's at its apogee (farthest point from Earth), it's about 406,000 k away. The moon's apogees occur 27.3 days apart. The moon will reach its apogee on January 22, 2016.
Find the formula of the trigonometric function that models the distance D between Earth and the moon t days after January 1, 2016. Define the function using radians.
D(t)=
So the steps I took are:

*

*Finding the amplitude:
(406000-36300)/2=21500

*Finding the midline:
21500+36300=384500

*Figuring out whether to use cosine or sine:

I figured that I can treat January 2nd as the beginning of the year. So I used cosine. Since at 0, a cosine function is at its max value.


*The period: 1 year is a period so it must be
2π/365

*The function without the shift is now:
21500cos(2π/365t)+384500

*Now I must find the value of u in order to properly shift the function. I imagine that this must be t−27.3 since it is 27.3 days after January 1.

I feel like I must be missing something here or got one of the steps wrong. Please guide me in the right direction.
 A: First the period is wrong. It's not 1 year. You are given that it's 27.3 days. And the phase you get from knowing that an apogee is on January 22nd, which is 21 days after January 1st. So $$d=21500\cos(2\pi/27.3(t-t_0))+384500$$
So knowing when you have the maximum (at 21 days), that's the phase. Just to check, plug in $t=21$ in the above equation.
A: $$
\cos t \text{ is the same as } \sin(t+\tfrac\pi2). \\
\sin t \text{ is the same as } \cos(t-\tfrac\pi2).
$$
The sine of one number is the cosine of another, so it can be done either way with different phase shifts. The sine and cosine functions are just phase-shifted versions of each other.
The cosine function reaches its peak when its argument is $0,$ so you can use a cosine function of the difference between any point in time and January 22.
The period is $27.3$ days, so the argument to the cosine function must increase by $2\pi$ every time $27.3$ days pass. If $t$ is time measured in days, then $(t-\text{January 22})$ is how many days have passed since January 22, and $(t-\text{January 22})/27.3$ is how many $27.3$-day periods have passed since then, so $2\pi\cdot(t-\text{January 22})/27.3$ increases by $2\pi$ every time a $27.3$-day period passes. Thus you need the cosine evaluated at that argument. Thus
$$
384500 + 21500 \cos\left( \frac{2\pi(t - \text{Jannuary 22})}{27.3} \right)
$$
which is the same as
\begin{align}
& 384500 + 21500 \sin\left( \frac{2\pi(t - \text{Jannuary 22})}{27.3} + \frac \pi 2 \right) \\[8pt]
= {} & 384500 + 21500 \sin\left( \frac{2\pi(t-(\text{somewhat earlier date}))}{27.3} \right)
\end{align}
That "somewhat earlier date" must be $27.3/4$ days before January 22, i.e. a quarter of a full period earlier, since $\tfrac\pi2$ is a quarter of $2\pi.$
The fraction of a day expressed by $\text{“}\cdots.3\text{''}$ in $\text{“}27.3\text{''}$ represents $0.3\text{ days} = 7.2 \text{ hours}.$
So
\begin{align}
& 27.3/4 \text{ days} = 6.825\text{ days} \\
= {} & 7\text{ days minus } 7.2 \text{ hours} \\
= {} & 7\text{ hours and 12 minutes}.
\end{align}
So for example, if 12:00 noon on January 22 is when apogee occurs, then 7:12 pm on January 15.
