Actually, I was asking you to show how you were able to solve it, and what result you got. It doesn't seem like an efficient way to do it, but perhaps it worked out better than I expect. And I was offering advice on how to avoid errors such as you know you made.

The problem statement was

The trouble with this is that it suggests that x and r are meant to be fixed numbers (base and hypotenuse of a triangle -- part of the statement of the problem), rather than variables to be used within the integration (which would not be part of the problem statement itself, but of the solution). You yourself stated that you initially treated r as a constant, but later realized it was not. Others pointed out that you used x as both the variable of integration, and a limit of integration, which is improper. These are the sorts of things that a full statement of the problem, together with a clear definition of any variables used, can prevent.

As I understand it, the problem statement would be, "Find the area of a right triangle with base ____ and height ____." I don't think you ever did identify variables for the base and height! Or, perhaps, you were aiming for a formula for the area of a triangle with base ____ and hypotenuse ____, which would be something like 1/2 b sqrt(h^2 - b^2). But, again, if r is a variable within the solution, what constant did you use for the entire hypotenuse? None of this is clear to me.

In particular, I'm curious why you would even want to mention the hypotenuse in a problem about area of a right triangle. (It's not the fact that you called it r, but that you didn't clarify its role in the problem, that was confusing.) Not that you can't, but it seems odd.