i have a question about optimization so this is the question i was given "the figure below consists of a rectangle ABCD and two semicircles on either end. the rectange as an area of 100 cm^2. If x represents the length of the rectangle AB, find the value of x that makes the perimeter of the entire figure a minimum."

so i did all the steps but i just don't get what im doing wrong... here is what i did

1) Area = x times w,

expressing w in terms of x i get w=100/x

2) the total perimeter will be the sum of the rectangle perimeter and the circle perimeter... the diameter of the circle is the same as the width...

3) plugging all known information i get,

P(total) = 200/x + 2x + 100pi/x

4) differentiating the function gives,

P'(total)= -200/x^2 + 2 - 100pi/x^2

5) solving for x i get x equal to 16.034 cm... i know that using the second derivative it gives that its a minimum point but for some reason the answer in the book is 12.5 cm... what did i do wrong here?