#### Answer

The width is $5$
The length is $8$

#### Work Step by Step

Let's consider a trinomial in this form: $~x^2+bx+c$
To factor this trinomial, we need to find two numbers $r$ and $s$ such that $r+s = b$ and $r\times s = c$
Then the next step is to rewrite the trinomial as follows:
$~x^2+bx+c = (x+r)~(x+s)$
We can rewrite the given equation:
$x~(x+3) = 40$
$x^2+3x = 40$
$x^2+3x-40 = 0$
To factor the left side of this equation, we need to find two numbers $r$ and $s$ such that $r+s = 3~$ and $~r\times s = -40$. We can see that $(8)+(-5) = 3~$ and $(8)\times (-5) = -40$
We can solve the equation as follows:
$x~(x+3) = 40$
$x^2+3x = 40$
$x^2+3x-40 = 0$
$(x+8)~(x-5) = 0$
$x+8=0~~$or $~~x-5=0$
$x = -8~~$ or $~~x=5$
Since the width must be a positive number, the width is $5$
Then the length is $5+3$ which is $8$