n(A) = 30, n(B) = 40 and n( AUB ) = 45.
Apply counting formula:
45 = 30 + 40 − n( A∩B ) (Substitute the values)
45 = 70 − n( A∩B )
n( A∩B ) = 70 − 45
n( A∩B ) = 25