Help with integral with parameter. I have this integral with parameter:
$$g(y)=\int_{0}^{\frac{\pi}{y}}\frac{\tan^2(xy)}{2x}dx$$
Also, $y>0$
So i want to calculate $g'$.
How can i do this?
Any help would be really helpful.
 A: Hint. Use the Leibniz integral rule. The first step is
$$g'(y)=\frac{\tan^2((\pi/y)\cdot y)}{2(\pi/y)}\cdot \frac{d}{dy}\left(\pi/y\right)
+\int_{0}^{\pi/y}\frac{d}{dy}\left(\frac{\tan^2(xy)}{2x}\right)dx.$$
A: Hint: This one is tricky, but the general idea is that if $$g(x, y) = \int_{a}^{x}f(t, y)\,dt\tag{1}$$ then $$dg = f(x, y)\,dx + \left(\int_{a}^{x}\frac{\partial }{\partial y}f(t, y)\,dt\right)dy\tag{2}$$ Apply this general rule on your integral.
Explanation: If $g(x, y)$ is a function of two variables then we know that $$dg = \frac{\partial g}{\partial x}\,dx + \frac{\partial g}{\partial y}\,dy$$ Here the function $g(x, y)$ depends on $x$ which is upper limit of integral (and hence we get $\partial g/\partial x$ via Fundamental Theorem of Calculus) and it also depends on $y$ which is a parameter under integral (and hence $\partial g/\partial y$ requires differentiation with respect to parameter $y$ under the integral sign).
A: $\newcommand{\angles}[1]{\left\langle\,{#1}\,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,\mathrm{Li}_{#1}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

Lets consider a 'more' general case: $\ds{\,\mrm{G}\pars{y} \equiv \int_{0}^{\pi/y}{\mrm{f}\pars{xy} \over 2x}\,\dd x}$ for 'some'
  $\ds{\,\mrm{f}}$ such that $\ds{\mrm{G}\pars{y}}$ converges. Indeed,
  $\ds{\,\mrm{G}\pars{y}}$ is $\ds{y}$-independent:

\begin{align}
\mrm{G}\pars{y} & =
\int_{0}^{\pi/y}{\mrm{f}\pars{xy} \over 2x}\,\dd x
\,\,\,\stackrel{x\ \equiv\ t/y}{=}\,\,\,
\int_{0}^{\pi}{\mrm{f}\pars{t} \over 2t}\,\dd t\quad\imp\quad
\color{#f00}{\mrm{G}'\pars{y}} = \color{#f00}{0}
\end{align}

As pointed out by $\texttt{@Jack Lam}$, the "OP-original integral" diverges because
  $\ds{\tan^{2}\pars{t} = {1 \over \tan^{2}\pars{\pi/2 - t}} \sim
{1 \over \pars{t - \pi/2}^{2}}}$
  as $\ds{t \to \pi/2}$.

