<s>[INST] How to find the inverse function of $f(x)=\sin^2\left(\frac{2x+1}{3}\right)$ and find its domain. $f(x)=\sin^2\left(\frac{2x+1}{3}\right)$ which is restricted on $-\frac{3\pi+1}{2}\le x< -\frac{3\pi+2}{4}$
I know I have to switch the $f(x)$ and the $y$:
$x=\sin^2\left(\frac{2f^{-1}(x)+1}{3}\right) \to \arcsin^2(x)=\frac{2f^{-1}(x)+1}{3} \to f^{-1}=\frac{3\arcsin^2(x)-1}{2}$
To find the domain:
$$-\frac{3\pi+1}{2}\le \frac{2x+1}{3}< -\frac{3\pi+2}{4}$$
$$-\frac{9\pi+3}{2}\le 2x+1< -\frac{9\pi+6}{4}$$
$$-\frac{9\pi+5}{2}\le 2x< -\frac{9\pi+10}{4}$$
$$-\frac{9\pi+5}{4}\le x< -\frac{9\pi+10}{8}$$
The inverse function is $f^{-1}=\frac{3\arcsin^2(x)-1}{2}$ and its domain is $-\frac{9\pi+5}{4}\le x< -\frac{9\pi+10}{8}$
But I am slightly confused since Desmos will not map it correctly. I'm asking if this is the correct solution or I went wrong somewhere.
Thanks
 [/INST] $$\text{Let $y^2 = f(x)=\sin^2\left(\frac{2x+1}{3}\right)$}$$
So $y \in [-1,1]$ and
$y=\sin\left(\dfrac{2x+1}{3}\right)$
where $\dfrac{2x+1}{3} = 2n\pi + \theta $ and $-\pi \le \theta \le \pi$
for some $n \in \mathbb Z$.
We compute
\begin{align}
   \theta &= \arcsin y \\
   \dfrac{2x+1}{3} &= 2n \pi + \arcsin y \\
   2x &= 6n \pi - 1 + 3 \arcsin y \\
   x &= 3n \pi - \dfrac 12 + \dfrac 32 \arcsin y \\
\end{align}
</s>