Solve for: 12c^2d-2cd+8cd^2-(-c^2d+4cd)-(5cd-2cd^2)

Expression: $12{c}^{2}d-2cd+8c{d}^{2}-\left( -{c}^{2}d+4cd \right)-\left( 5cd-2c{d}^{2} \right)$

When there is a $-$ in front of an expression in parentheses, change the sign of each term of the expression and remove the parentheses

$12{c}^{2}d-2cd+8c{d}^{2}+{c}^{2}d-4cd-\left( 5cd-2c{d}^{2} \right)$

Factor out $cd$ from the expression

$12{c}^{2}d-2cd+8c{d}^{2}+{c}^{2}d-4cd-cd \times \left( 5-2d \right)$

Collect like terms

$13{c}^{2}d-2cd+8c{d}^{2}-4cd-cd \times \left( 5-2d \right)$

Collect like terms

$13{c}^{2}d-6cd+8c{d}^{2}-cd \times \left( 5-2d \right)$

Factor out $cd$ from the expression

$cd \times \left( 13c-6+8d \right)-cd \times \left( 5-2d \right)$

Factor out $cd$ from the expression

$cd \times \left( 13c-6+8d-\left( 5-2d \right) \right)$

When there is a $-$ in front of an expression in parentheses, change the sign of each term of the expression and remove the parentheses

$cd \times \left( 13c-6+8d-5+2d \right)$

Calculate the difference

$cd \times \left( 13c-11+8d+2d \right)$

Collect like terms

$cd \times \left( 13c-11+10d \right)$