\(A=\left(x+1\right)\left(x^2-x+1\right)+x-\left(x-1\right)\left(x^2+x+1\right)+2021\)
\(=x^3+1+x-x^3+1+2021\)
\(=x+2023\)
=-2022+2023
=1
\(A=\left(x+1\right)\left(x^2-x+1\right)+x-\left(x-1\right)\left(x^2+x+1\right)+2021=x^3+1+x-x^2+1+2021=x+2023=-2022+2023=1\)