How to plot cosine with trigonometric identity There is the well-known trigonometric identity: $\sin^2(x)+\cos^2(x) = 1$. Without giving a second thought I took use of it to convert from cosine to sine. Especially in physics involving reflections: $\frac{n_2}{n_1}\,\cos(\alpha_2) = \frac{n_2}{n_1}\,\sqrt{1-\sin^2(\alpha_2)}$. This helped many times. Just now I realized that plotting both sides of the equation actually lead to two different graphs. Even plotting $\pm\sqrt{1-\sin^2(\alpha_2)}$ does not equal the simple cosine. It seems like there has to be a piecewise function defined giving the positive square for positive $\alpha_2$ and vice versa. But why the first substitution without any case differentiation works in physical context?

*

*$$f(\alpha_2)=\cos(\alpha_2)$$ is a function because each input
$\alpha_2$ returns a certain corresponding output $f(\alpha_2).$
Likewise for the function $$g(\alpha_2)=\sqrt{1-\sin^2(\alpha_2)}.$$
As $\alpha_2$ varies over the real numbers (let's work in radians),
the values of $f(\alpha_2)$ and $g(\alpha_2)$ coincide precisely
when $\alpha_2$ lies in the $1$st or $4$th quadrant (e.g., when
$\alpha_2$ is acute). In this case, ($\cos\alpha_2$ is
non-negative and) $$\cos(\alpha_2)=\sqrt{1-\sin^2(\alpha_2)}\tag1$$
instead of the more general
$$\cos(\alpha_2)=\pm\sqrt{1-\sin^2(\alpha_2)}\tag2.$$

*On the other hand, $$h(\alpha_2)=\pm\sqrt{1-\sin^2(\alpha_2)}$$ is
not a function: its graph is symmetrical in the $x-$axis because each input value of $\alpha_2$ corresponds to two possible
outputs.

*The equality $$\cos^2(\alpha_2)=1-\sin^2(\alpha_2)$$ is called an identity because it is true for every possible value of $\alpha_2$. On the other hand, $(1)$ and $(2)$ are equations that are true for particular values of $\alpha_2$ (and which we are using to solve for $\alpha_2,$ for conversion between trigonometric ratios, etc.).

