Could some one explain me with the mathematical relations on how the double bubble fuselage cross section (example A380) is designed.
A380 actually has an elliptical cross section, not double bubble. 'Double bubble' fuselage cross sections (also called double lobe) are usually used in case of aircraft which require specific arrangements for carrying passengers/cargo and in which case using a circular or elliptical fuselage would result in a large wastage of space or because this type of arrangement is cheaper to make. Another reason for this appearance is that some aircraft were extensively modified (for reasons other than the original intentions) resulting in this shape.

The double lobe fuselage aims to reduce the wasted space by having fuselage in two intersecting circles, joined together at the floor. The (relative) size of the circles is determined by the requirements. A good example is the Boeing C-97 Stratofreighter, which was a military transport based on B-29 Superfortress.

Boeing notes:


  ... it had a double-lobe fuselage consisting of two intersecting circular sections, so that the 74-foot-long (23-meter-long) upper deck had a larger diameter.




Image from Boeing.com

The civilian counterpart of the C-97, the Boeing 377 Stratocruiser inherited this shape having a double lobed structure, with 100 passengers on the main deck plus 14 in the lower deck lounge.



Boeing 377 Stratocruiser fuselage cross section; image from tdpri.com

These aircraft were later modified to carry oversized aircraft parts as the Pregnant Guppy, Super Guppy and Mini Guppy, all having the distinctive double lobed design.

Note that most of the double bubble aircraft are for carrying cargo. Contemporary aircraft with a similar arrangement include the Airbus Beluga which again are used for transporting oversized aircraft parts.



Airbus beluga, image from australianaviation.com.au

The Beluga is an example of how specialized requirements required this design. This aircraft was designed because none of the available large transports had enough space to transport the required sub-assemblies. Designing and building a new aircraft for carrying these sub-assemblies (including fuselage sections) would have been prohibitive (only five were made); so Airbus modified an existing aircraft according to requirements.

Another aircraft that acquired this shape as a result of modifications was the Hawker Siddeley Nimrod, which had this shape due the addition of a bottom section to the De Havilland Comet. The lower section had the radar, bomb bay etc, while the upper section had the crew.

Quite a few airliners have utilized this shape in the past, though the shape is not as pronounced. Airline manufacturers, from Boeing to Douglas used them as they are efficient in using space. For example, the Boeing 707 fuselage cross section below shows this design.



707 fuselage cross section; image from forum.justflight.com

Also, as I noted before, the A380 has an elliptical cross section, not double bubble.