We can solve this by breaking into two cases depending on whether `cosx` is positive or negative.

We know that `cosx` for `x in [0,pi/2)` and negative for`x in(pi/2,(3pi)/2)`, so for `x in [0,pi/2)` `|cosx|=cosx` and for `x in(pi/2,(3pi)/2)` `|cosx|=-cosx`, thus we have:

`int_0^((3pi)/2)|cosx|dx=int_0^(pi/2)cosxdx-int_(pi/2)^((3pi)/2)cosxdx=sinx|_0^(pi/2)-sinx|_(pi/2)^((3pi)/2)=`

`1-0-(-1-1)=1+1+1=3`

Note: Above we have used the following property of integral:

Let `f` be integrable on segment `[a,b]` and let `c in (a,b)` then we have

`int_a^bf(x)dx=int_a^cf(x)dx+int_c^bf(x)dx`.

For more on definite integrals see the link below.