I have found the following exercise in the book of Crespo and Hajto “Algebraic groups and differential Galois theory”:
Let $$\mathcal{L}(Y):=Y^{(n)}+a_{n-1}Y^{(n-1)}+\dots+a_1Y’+a_0=0$$ and let $W$ denote the Wronskian determinant of a fundamental set of solutions of the equation. Prove that if $a_{n-1}=0$ then $W$ is constant and $\mbox{Gal}(\mathcal{L})$ is contained in the special linear group.
My question is not on the proof of this fact. I don’t know how to interpret this result: for instance, I can consider the equation $Y’’+Y=0,$ which satisfies the conditions of the theorem, but its differential Galois group is
$$\left\{\begin{bmatrix}\alpha&\beta\\-\beta&\alpha\end{bmatrix}:\alpha,\beta\in\mathbb{C}, \text{not both }0\right\},$$
which is not contained in $SL_2(\mathbb{C}).$ Where is the error?
The error is that your representation of the differential Galois group is wrong. The roots are $Ae^{ix}$ and $Be^{-ix}$. Any differential automorphism must map $e^{ix}$ to $\alpha e^{ix}$ with $\alpha\in\mathbb C^\times$, and then must map $e^{-ix}$ to the reciprocal of that. So the matrix group is $$ \left\{\begin{pmatrix} \alpha & 0 \\ 0 & \alpha^{-1} \end{pmatrix}, \quad \alpha \in \mathbb C^\times\right\} \subset \mathrm{SL}_2(\mathbb C)$$