Let
$$p(x)= \begin{cases} M \in \mathbb{R}, & x \in \left(\frac{1}{2}-\delta,\frac{1}{2}+\delta\right) \\ 1, & x\in \left(0,\frac{1}{2}-\delta)\cup(\frac{1}{2}+\delta,1\right) . \end{cases}$$
An asymptotic expansion for the equation (known as the Elastic Differential Equation);
$$y'' + \lambda^{2} p(x) y = 0$$
where $\lambda$ is a variable, and $(a,b)=(0,1)$ is;
$$y(x,\lambda)=e^{i\lambda}\int_0^1 \sqrt{p(s)ds}\left[\frac{1}{p(x)^{\frac{1}{4}}}+\frac{1}{\lambda_1}(d(x)+\frac{e_+}{p(x)^{\frac{1}{4}}})\right]+e^{-i\lambda}\int_0^1 \sqrt{p(s)ds}\left[\frac{-1}{p(x)^{\frac{1}{4}}}+\frac{1}{\lambda_1}(d(x)-\frac{e_+}{p(x)^{\frac{1}{4}}})\right]+\mathcal{O}(\frac{1}{\lambda^2})$$
Where $e_+$ is a constant, and;
$$d(x)=\frac{i}{2(p(x))^{\frac{1}{4}}}\int_a^x \frac{5(p'(x))^2}{16(p(x))^{\frac{5}{2}}}dx -\frac{i}{2(p(x))^{\frac{1}{4}}}\int_a^x \frac{p''(x)}{4(p(x))^{\frac{3}{2}}}dx$$
Now
$$y_1'' + \lambda^2 y_1 = 0, x\in\left(0,\frac{1}{2}-\delta\right)$$
$$y_2'' + \lambda^2 M y_2 = 0, x\in\left(\frac{1}{2}-\delta, \frac{1}{2}+\delta\right)$$
$$y_3'' + \lambda^2 y_3 = 0, x\in\left(\frac{1}{2}+\delta,1\right)$$
$y_1$, $y_2$, $y_3$ have solutions of the form;
$$y_1=a_1 e^{i\lambda x} + b_1 e^{-i\lambda x}$$
$$y_2=a_2 e^{i\lambda\sqrt{M}x} + b_2 e^{-i\lambda\sqrt{M}x}$$
$$y_3=a_3 e^{i\lambda x} + b_3 e^{-i\lambda x}$$Initial value and boundary conditions:
$$y_1\left(\frac{1}{2}-\delta\right)=y_2\left(\frac{1}{2}-\delta\right)$$ $$y_1'\left(\frac{1}{2}-\delta\right)=y_2'\left(\frac{1}{2}-\delta\right)$$ $$y_2\left(\frac{1}{2}+\delta\right)=y_3\left(\frac{1}{2}+\delta\right)$$ $$y_2'\left(\frac{1}{2}+\delta\right)=y_3'\left(\frac{1}{2}+\delta\right)$$ $$y_1(0)=0$$ $$y_3(1)=0$$
Then using these 6 equations I get the system;
$$\begin{bmatrix} g & \frac{1}{g} & -f & -\frac{1}{f} & 0 & 0 \\ i\lambda g & \frac{-i\lambda}{g} & -i\lambda \sqrt{M}f & \frac{i\lambda \sqrt{M}}{f} & 0 & 0 \\ 0 & 0 & h & \frac{1}{h} & -k & \frac{-1}{k} \\ 0 & 0 & i\lambda\sqrt{M}h & -\frac{i\lambda\sqrt{M}}{h} & -i\lambda k & \frac{i\lambda}{k} \\ 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 \end{bmatrix}.\begin{bmatrix} a_1 \\ b_1 \\ a_2 \\ b_2 \\ a_3 \\ b_3 \end{bmatrix}=0$$
Where;
$$f= e^{i\lambda \sqrt{M}\left(\frac{1}{2}-\delta\right)}$$ $$g= e^{i\lambda \left(\frac{1}{2}-\delta\right)}$$ $$h= e^{i\lambda \sqrt{M}\left(\frac{1}{2}+\delta\right)}$$ $$k= e^{i\lambda \left(\frac{1}{2}+\delta\right)}$$
What I am trying to do;
Deriving formulae for $M$ and $\delta$, then hence obtain eigenvalues and eigenfunctions for $y(x,\lambda)$.
I have done work on this, and will provide what I have done in the future via updates to this question;
Attempt 1);
Simplifying the first matrix using Gaussian elimination, then have 6 equations;
$a_1=0$, $b_1=0$, $a_2=0$, $b_2=0$, $a_3=0$, $b_3=0$
Hence $y_1 = y_2 = y_3 =0$, but no apparent useful results to me for $M$ and $\delta$.
Attempt 2);
--To be updated--
Using the fact that the determinant of the 1st matrix is equal to 0 for the system to have solutions, I have then expanded this determinant to give the following equation;
$$-8\sqrt{M}+(1-\sqrt{M})\frac{fg}{hk}+(1+2\sqrt{M}-M)\frac{hk}{fg}+(1+2\sqrt{M}+M)(\frac{fk}{gh}+\frac{gh}{fk})=0$$
This then simplifies to;
--To be updated--
$$a^{2}s^{4a\delta}-a^{2}s^{2\delta(2a-2)}-a^{2}s^{2\delta(a+1)}-8(a+1)s^{2a\delta}+(2-a)=0$$
where $M \ge 0 \in \Bbb R$, $a=\sqrt{M}+1 \in \Bbb R$, $s=e^{i\lambda} \in \Bbb C$, $a \ge 1$, $\delta \in \Bbb R$.
(I have another question where I ask for help on this equation.)
Attempt 3)
Using the fact that the determinant of the characteristic matrix is equal to 0 for eigenvalues;
--To be updated--
$$\det\begin{bmatrix} f-X & \frac{1}{f} & -g & -\frac{1}{g} \\ i\lambda \sqrt{M}f & \frac{-i\lambda \sqrt{M}}{f}-X & -i\lambda g & \frac{i\lambda}{g} \\ h & \frac{1}{h} & -k-X & -\frac{1}{k} \\ i\lambda\sqrt{M}h & -\frac{i\lambda\sqrt{M}}{h} & -i\lambda k & \frac{i\lambda}{k}-X \end{bmatrix}=0$$
where $X$ is an eigenvalue.
I have then got a cubic equation in $X$ , from simplifying this;
$$a'X^3 + a''X^2 + a^{(3)}X + a^{(4)} + a^{(5)} + a^{(6)}=0 $$
The coefficients of this cubic equation, $a^{(n)}$ though are complex functions of $\lambda, M, f, g, h$ and $k$.
Questions / help requested;
1) Derivation of the eigenvalues and eigenvectors, what this means for $M$ and $\delta$, and an example illustrating this.
2) Derivation of formulae for $M$ and $\delta$.
3) What happens to $M$ & $\delta$ as $\lambda$ tends to infinity?
4) I am not sure which method - Attempt 1 / Attempt 2 / Attempt 3 is more fruitful. Am I approaching this in a sound way? What would be better method(s) if any?
The (translated) problem at hand is the following:
Due the definition of $p(x)$, we have three regions: $(-\tfrac{1}{2},-\delta)$, $(-\delta,\delta)$ and $(\delta,\tfrac{1}{2})$. This means that we are looking for $$ y(x) = \begin{cases} y_1(x) & \text{if } -\tfrac{1}{2} < x < - \delta,\\ y_2(x) & \text{if } -\delta < x < \delta,\\ y_3(x) & \text{if } \delta < x < \tfrac{1}{2},\end{cases} $$ where $$ y_1\big(-\tfrac{1}{2}\big) = 0,\quad y_1(-\delta) = y_2(-\delta),\quad y_1'(-\delta) = y_2'(-\delta), $$ $$ y_2(\delta) = y_3(\delta),\quad y_2'(\delta) = y_3'(\delta),\quad y_3\big(\tfrac{1}{2}\big) = 0. $$
Now, it's fairly simple to see that $$ y(x) = \begin{cases} A_1 \sin\left[\lambda\big(x + \tfrac{1}{2}\big)\right] & \text{if } -\tfrac{1}{2} < x < - \delta,\\ B_1 \sin\left[\lambda\sqrt{M}x\right] + B_2 \cos\left[\lambda\sqrt{M}x\right] & \text{if } -\delta < x < \delta,\\ C_1 \sin\left[\lambda\big(x - \tfrac{1}{2}\big)\right] & \text{if } \delta < x < \tfrac{1}{2},\end{cases} $$ is a solution of the ODE that satisfies the boundary conditions. Writing the continuity conditions in matrix form, we have that $$ \small \begin{pmatrix} \sin \left[\left(\frac{1}{2}-\delta \right) \lambda \right] & \sin \left[\delta \lambda \sqrt{M}\right] & -\cos \left[\delta \lambda \sqrt{M}\right] & 0 \\ \lambda \cos \left[\left(\frac{1}{2}-\delta \right) \lambda \right] & -\lambda \sqrt{M} \cos \left[\delta \lambda \sqrt{M}\right] & -\lambda \sqrt{M} \sin \left[\delta \lambda \sqrt{M}\right] & 0 \\ 0 & \sin \left[\delta \lambda \sqrt{M}\right] & \cos \left[\delta \lambda \sqrt{M}\right] & -\sin \left[\left(\delta -\frac{1}{2}\right) \lambda \right] \\ 0 & \lambda \sqrt{M} \cos \left[\delta \lambda \sqrt{M}\right] & -\lambda \sqrt{M} \sin \left[\delta \lambda \sqrt{M}\right] & -\lambda \cos \left[\left(\delta -\frac{1}{2}\right) \lambda \right] \end{pmatrix} \begin{pmatrix}A_1 \\ B_1 \\ B_2 \\ C_1 \end{pmatrix} = 0. $$ The system has nontrivial solutions iff the matrix determinant is equal to zero, i.e., $$ \small -\frac{\lambda^2}{4}\begin{pmatrix} u\\v \end{pmatrix}^T \begin{pmatrix} -\sin\left[(2\delta v + 1)\lambda\right] & \sin \left[(u + v)\delta \lambda\right] \\ \sin \left[(u + v)\delta \lambda\right] & -\sin\left[(2\delta u - 1)\lambda\right] \end{pmatrix} \begin{pmatrix} u\\v \end{pmatrix} = 0, $$ where $u = \sqrt{M} + 1$ and $v = \sqrt{M}-1$. It's clear that $\lambda = 0$ would lead to a trivial solution, so $\lambda = 0$ is not an eigenvalue. Hence, we are looking for solutions to the transcendental equation $$\label{eigeq} \small \begin{pmatrix} u\\v \end{pmatrix}^T \begin{pmatrix}-\sin\left[(2\delta v + 1)\lambda\right] & \sin \left[(u + v)\delta \lambda\right] \\ \sin \left[(u + v)\delta \lambda\right] & -\sin\left[(2\delta u - 1)\lambda\right] \end{pmatrix} \begin{pmatrix} u\\v \end{pmatrix} = 0. \tag{1} $$ We see that taking $M = 1$ or $\delta = 0$ leads to the relation $$ \sin \sqrt{\lambda} = 0, $$ which is to be expected.
For the full characterization of the problem, you'll need to study the zeros of \eqref{eigeq}.
I'm hoping that due the symmetric form of eq. \eqref{eigeq}, something more can be said, but I haven't had the time to look into it. Quick asymptotics show that, if $\sqrt{M} \gg \delta$, the eigenvalues are such that $\lambda_n \sim \frac{n \pi}{2 \delta \sqrt{M}}$. For large eigenvalues, you can use an educated combination of the WKB approximation and the Sturm–Picone comparison theorem, or variational methods (see Friedman's Principles and techniques of applied mathematics, for example).