The ven diagram for the problem :-
It is given 6 gears are non defective.
So, no of gears are defective=total – no of gears non -defective
$=40-6=34$
So, $|R\cup B |=34$.
It is given 28 gears either broken or rusted but not both and it is also given no of broken gear equals to no of rusted gears.
So which means 14 gears are only rusted not broken and 14 gears are broken but not rusted.
Which is mathematically ,
$|R – B|=14$
$|B – R|=14$
So, We need to find $|R\cap B |$ .
$|R\cup B |=|R-B|+|B-R|+|R\cap B |$
=> $|R\cap B |$=$34-14-14 =6$
So ,$6$ gears are both rusted and broken.
We need to find rusted gears which is $|R|$=$|R – B|$+$|R\cap B |$=$14+6=20$
So ,Total number of rusted gears is $20$.