# Tutor profile: Alexander B.

## Questions

### Subject: Calculus

Describe the area of a triangle using a definite integral.

For a triangle of height h and base b, we can - via Cavalieri's principle - imagine this as a right triangle, with the hypotenuse on the line going through (0,0) and (b,h). In that case, the area of the triangle is the area under that line from x=0 to b. In other words, $$A=\frac{h}{b}\int_0^b x dx$$ $$A=\frac{h}{b} * \frac{b^2}{2}$$ $$A=\frac{1}{2}bh$$

### Subject: C++ Programming

What is the output of the following function when the value of a is 2 and the value of b is 5: void func(int a, int b) { int c = 0; for (int i = a; i <= b; i++) { c += i; } return c; }

This function actually causes a compile error, because the return type is void, but we attempt to return a variable (int c). If the return type were int, however, the function would return 14.

### Subject: Algebra

$$ 5 x + \frac{3}{y} = x +2 $$ Solve for y.

$$ 5 x + \frac{3}{y} = x +2 $$ $$\frac{3}{y} = -4x +2 $$ $$3 = y(-4x +2) $$ $$y=\frac{3}{-4x +2}$$ Check to see when $$-4x+2=0$$: $$-4x=-2$$ $$x=\frac{-2}{-4}=\frac{1}{2}$$ Therefore, $$y=\frac{3}{-4x+2}$$ but has no solution at $$x=\frac{1}{2}$$

## Contact tutor

needs and Alexander will reply soon.