Yes, Albert Einstein did write equations longer and more complex than the famous equation E=mc². One notable example is the field equations of general relativity, which can be represented by the following equation:
R_{μν} - 1/2 g_{μν} R + Λg_{μν} = (8πG/c⁴) T_{μν}
Here, R_{μν} represents the components of the Ricci curvature tensor, g_{μν} is the metric tensor representing the geometry of spacetime, R is the scalar curvature, Λ is the cosmological constant, T_{μν} is the stress-energy tensor representing the distribution of matter and energy, G is the gravitational constant, and c is the speed of light.
Einstein formulated these equations as part of his theory of general relativity, which he developed between 1907 and 1915. The field equations describe how matter and energy curve spacetime and how the curvature influences the motion of matter and energy. They provide a more comprehensive and accurate description of gravity than Newton's law of universal gravitation.
Einstein's motivation for developing general relativity and formulating these complex equations was to reconcile Newtonian mechanics with the theory of special relativity, which he had developed earlier. General relativity aimed to provide a more complete theory of gravity that would account for the observed phenomena, such as the bending of starlight by gravity and the perihelion precession of Mercury's orbit. The equation represents a mathematical representation of the relationship between matter-energy distribution and the curvature of spacetime, allowing for the prediction and explanation of various gravitational effects.