This question was asked in Ex 3.4, 4
General formula 
In ex 3.4


Shweta Singh's image