<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] Look at the plot below (first picture). The function can be inverted only in the interval where it is bijective.
Take the derivative
$$f'(x)=\frac{4}{3} \sin \left(\frac{1}{3} (2 x+1)\right) \cos \left(\frac{1}{3} (2 x+1)\right)=\frac{2}{3} \sin \left(\frac{2}{3} (2 x+1)\right)$$
$$f'(x)=0\to  \sin \left(\frac{2}{3} (2 x+1)\right)=0$$
In the interval we are interested in, this happens when
$$\frac{2}{3} (2 x+1)=0;\;\frac{2}{3} (2 x+1)=\pi$$
which gives $$x_1=-\frac12;\;x_2=\frac{3 \pi }{4}-\frac{1}{2}$$
We will invert $f(x)$ in the interval $[x_1,x_2]$.
Set $y=f(x)$ and get
$$\sin ^2\left(\frac{1}{3} (2 x+1)\right)=y\to  \sin \left(\frac{1}{3} (2 x+1)\right)=\sqrt{y}$$
then
$$\frac{1}{3} (2 x+1)=\arcsin\sqrt y\to 2x+1=3\arcsin\sqrt y\to x=\frac{1}{2} \left(3 \arcsin\left(\sqrt{y}\right)-1\right)$$
Only now we swap $x$ and $y$ to get
$$f^{-1}(x)=\frac{1}{2} \left(3 \arcsin\left(\sqrt{x}\right)-1\right)$$
The domain of $f^{-1}(x)$ is the range of $f(x)$ that is $[0,1]$.
Look at the second picture below. The inverse function graph is the symmetric of the function $f(x)$ wrt the line $y=x$.

$$...$$


</s>