Given ellipse is E1:a2x2+b2y2=1,a>b and E2 is another ellipse which touches the end points of the major axis of E1 and foci of E2 are at the minor axis of E1, thus the two ellipses are given by the following diagram.

Since, the ellipse E2 touches the major axis of the ellipse E1, hence, the minor axis of the ellipse E2 is a1=a.
Now, let the major axis of the ellipse E2 is b1=c and it is obvious from the diagram and the given conditions that b1>a1.
We know that the eccentricity of an ellipse A2x2+B2y2=1,A>B is 1−A2B2.
Thus, for the ellipse E1, we have e=1−a2b2 and for the ellipse E2, we have e1=1−c2a2.
Given, e=e1
1−a2b2=1−c2a2
⇒1−a2b2=1−c2a2
⇒a2b2=c2a2
⇒c2=b2a4
⇒c=ba2...(i)
Also, given that the foci of E2 are the end points of the minor axis of E1, thus b=ce
⇒c=eb...(ii)
From the above two equations, we get eb=ba2
⇒e=a2b2
Now, using the definition of eccentricity, we get e=a2b2=1−e2
⇒e2+e−1=0
Now, applying the Sridharacharya's formula for the roots of a quadratic equation, i.e. if ax2+bx+c=0,a=0, then x=2a−b±b2−4ac, we get
e=2×1−1±12−4×1×(−1)
⇒e=2−1±1+4
⇒e=2−1±5
But, eccentricity can never be negative, hence e=2−1+5.