`a)`\(A=2x\left(x+1\right)-2\left(x-1\right)\left(x+4\right)-5\)
\(A=2x^2+2x-\left(2x-2\right)\left(x+4\right)-5\)
\(A=2x^2+2x-\left(2x^2+8x-2x-8\right)-5\)
\(A=-4x+3\)
`b)`\(B=\left(2x-1\right)\left(2x+1\right)-4x\left(5-x\right)+\left(3-x\right)\left(x+4\right)\)
\(B=4x^2-1-20x+4x^2+3x+12-x^2-4x\)
\(B=7x^2+21x+11\)