Some hints:

Using the definition of derivative, you need to show that
$$
\lim_{h\rightarrow 0^+} {f(a+h)-f(a)\over h }
$$
exists and is equal to $\lim\limits_{x\rightarrow a^+} f'(x)$.

Note that for $h>0$ the Mean Value Theorem provides a point $c_h$ with $a<c_h<a+h$ such that
$$
{f(a+h)-f(a)\over h } =f'(c_h).
$$

Finally, note that $c_h\rightarrow a^+$ as $h\rightarrow0^+$.

$$
\left(\frac{\sin^2 x}{2} +\text{constant}\right) \text{ is the same thing as }\left(\frac{-\cos^2 x}{2} +\text{constant}\right),
$$
but the two "constants" are different. It's just a trigonometric identity:
$$
\frac{\sin^2 x}{2} +\text{constant} = \frac{1-\cos^2 x}{2}+\text{constant} = \frac{-\cos^2 x}{2} + \frac12+\text{constant}
$$
and then $\dfrac12+\text{constant}$ is also a constant.

I'm not sure exactly what you have in mind in your question #1, but if you do things correctly, the result will be correct.

You appear to be integrating by parts in a problem in which integration by substitution would be quicker. You have
$$
\int f(x)g'(x)\,dx = f(x)g(x) - \int f'(x)g(x)\,dx.
$$
That means that if you find any antiderivative of $f'(x)g(x)$ and any antiderivative of $f'(x)g(x)$ and put the former in place of the integral on the right and the latter in place of the integral on the left, then the expressions on the two sides of the equality will differ by some constant. Which constant it is depends on which antiderivative you find.

However, there is this other complication: the difference between the two sides, casually reported to be a "constant", is actually constant on each connected component of the domain separately. For example, suppose the functions on the two sides of the equality are undefined at $x=5$. That "disconnects" the domain into separate components: numbers greater than $5$ and numbers less than $5$. It may happen that the "constant" on one of those two components differs from the "constant" on the other component. In that sense the function is not actually constant, but its restriction to any connected component of the domain is constant. None of this affects the present problem.

## Best Answer

If $f$ is continuous, the function $F(x) = \int_a^x f(t)dt$ is differentiable with derivative $F'(x) = f(x)$. Notice that $$\lim_{h\to 0}\frac{\int_x^{x+h}f(t)dt}{h} = \lim_{h\to 0}\frac{\int_a^{x+h}f(t)dt - \int_a^x f(t)dt}{h} = \lim_{h\to 0}\frac{F(x+h) - F(x)}{h}$$ and use the definition of the derivative.

It has been pointed out by Stephen Donovan that perhaps this problem arose in proving the fundamental theorem of calculus. In that case, the comments on the original post detail some methods of solution.