A mechanical plane system is in state of equilibrium if the virtual work done by all real forces and moment is zero for every virtual displacement consistent with the constraints.

Where P, R, M are real loads and reactions DX, DY, O are external virtual displacement and (pi, DJ), (Mjdj), (Rkdk),(Mkok) are scalar products of two vectors.
A deformable plane system is in state of equilibrium if the total virtual work done by the real external forces and moment is equal to the total virtual work done by all the internal stresses for every virtual displacement consistent with the constraints
Deflection of simple beam by work method using Castiglione’s theorem
Castiglione’s first theorem provides an important method for computing deflection. Its application involved the equating of the deflection to the first partial derivative of the total internal wall of the structure with a respect to a load at the point where deflection is desired. Castiglione’s 2nd theorem commonly known as the method of least work , provides a very important method for the analysis of statically indeterminate structures. In applying this later theorem the first derivative of the internal wall with respect to each redundant is set equal to zero.
Castiglione’s first theorem
The load is a beam that is subjected to the gradually applied load p1 and p2. These loads caused the deflection d1 and d2 . it is desired to find the deflection at d1, at the application of the load must equal the average load multiplied the deflection and it also must equal the internal strain energy of the beam.
Should the load be increased by small amount dp1, the beam will deflect additionally.
The additional work performed or the strain energy stored during the application of dp1 is as follows:
Performing the indicated multiplication and neglecting the product of differentials:
The same procedure is repeated except the load p1, p2 & dp, are applied at the same time and the total strain energy is represented by “W”
Performing the indicated multiplication and neglecting the Product of differentials:
It is obvious that DW equals W^1 -W and can be obtained by subtracting equation(1) from equation (3)
From the equation below the value of p2dd2 can be obtained as follows p2dd2= dw-p1dd1 by subtracting this value into equation (4) and solving for the derived deflection d1
Since more than one action is applied to a structure this deflection is usually written as a partial derivative as follows
In applying the theorem , the load at the point where deflection is desired is referred to as P. After the operations required in the equations are completed , the numerical value of P is replaced in the expression, should there be no load at the point or in direction in which deflections are desired , An imaginary force p will be placed there in the direction desired after this operation is completed, the correct value of P (0) will be substituted in the expression.
The diagram above was meant to come first before the full solution to the problem. The vertical load will be replaced with dummy load P
Wow, have learnt something today, all thanks to insidecivil.com .But I have a question, considering example 1. The cantilever beam is imposed with two loads, one at the free end(10kN) and the other at the mid span (20kN). What if the the 20kN load located at 15m away from the free end, taking moment in span BC only and integrating as well what will it look like. Am waiting for your reply plsssssss!!!?!