Show that a homogeneous function satisfies the PDE $x \frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y} = n f(x,y)$ I'm using the following definition of a homogeneous function.

A function $f(x,y)$ is homogeneous of degree n if it satisfies the following equation $$f(tx, ty) = t^n f(x,y) \quad (1)
$$ for all $t$ where $n>0$

Problem
Show that if $f$ is homogeneous of degree n, then
$$x \frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y} = n f(x,y) $$
Attempted Solution
I differentiated $(1)$ w.r.t $t$ giving me
$$
\begin{align*}\frac{\partial f}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial t} &= nt^{n-1} f(x,y)  \\ x\frac{\partial f}{\partial x} + y\frac{\partial f}{\partial y}&=nt^{n-1} f(x,y) \end{align*}
$$
The LHS looks okay, but I'm not sure how to handle the $t^{n-1}$ term on the RHS.
 A: Note that, in your calculation, you have hidden an important information. What you have shown is
$$xf_x(tx, ty)+yf_y(tx,ty) = nt^{n-1}f(x,y)$$.
Replace $v=tx, w=ty$ to arrive at
$$\frac{1}{t}(vf_x(v,w)+wf_y(v,w))= nt^{n-1}f(\frac{v}{t},\frac{w}{t}) $$
and use homogeneity on the RHS again.
A: This is also known as Euler’s theorem.

Euler’s theorem   Let $f : \mathbb{R}^n_+ \to \mathbb{R}$ be continuous, and also differentiable on $\mathbb{R}^n_{++}$. Then $f$
  is homogeneous of degree $k$ if and only if for all $x \in
> \mathbb{R}^n_{++}$, $$kf(x) = \sum^n_{i=1} D_if(x)x_i \, \, \ldots \, \,\,(∗)$$

Proof: ($\Rightarrow$) Suppose $f$ is homogeneous of degree $k$. Fix $x \in \mathbb{R}^n_{++}$, and define the function $g : [0, \infty) \to \mathbb{R} $ (depending on x) by $$g(\lambda) = f(\lambda x) − \lambda ^kf(x)$$
and note that for all $\lambda  ⩾ 0$,
$$g(\lambda ) = 0$$
Therefore, $$g′(\lambda ) = 0$$ for all $\lambda  > 0$. But by the chain rule,
$$g′(\lambda ) = \sum^n_{i=1} D_if(x)x_i − k\lambda ^{k−1}f(x)$$
Evaluate this at $\lambda  = 1$ to obtain $(∗)$.
($\Leftarrow$) Suppose $$kf(x) = \sum^n_{i=1} D_if(x)x_i$$ for all $x \in
\mathbb{R}^n_{++}$. Fix any $x ≫ 0$ and again define $g : [0, \infty) \to \mathbb{R} $ (depending on $x$) by $$g(\lambda ) = f(\lambda x) − \lambda ^kf(x)$$ and note that $g(1) = 0$. Then for $\lambda  > 0$,
$$g′(\lambda ) = \sum^n_{i=1} D_if(\lambda x)x_i − k\lambda ^{k−1}f(x)$$ $$= \lambda^{-1}\sum^n_{i=1} D_if(\lambda x)\lambda x_i − k\lambda ^{k−1}f(x)$$ 
$$= \lambda^{-1} kf(\lambda x) − k\lambda ^{k−1}f(x)$$
So
$$\lambda g′(\lambda ) = kf(\lambda x) − \lambda ^kf(x))= kg(\lambda )$$
Since $\lambda $ is arbitrary, $g$ satisfies the following differential equation:
$$g′(\lambda ) −\frac{k}{\lambda }g(\lambda ) = 0$$
and the initial condition $g(1) = 0$. By theorem below,
$$g(λ) = 0 \cdot e^{A(\lambda )} + e^{−A(\lambda )}\int_1^{\lambda} 0 \cdot e^{A(t)}dt = 0$$
where, irrelevantly, $$A(\lambda ) = −\int_1^{\lambda} \frac{k}{t} dt = −k \ln \lambda $$ 
This implies $g$ is identically zero, so $f$ is homogeneous on $\mathbb{R}^n_{++}$. Continuity guarantees that $f$ is homogeneous on $\mathbb{R}^n_{+}$.
A: For $t \in \mathbb{R}$, what you have shown is
$$x\frac{\partial f}{\partial x}(tx, ty)+y\frac{\partial f}{\partial y}(tx,ty) = nt^{n-1}f(x,y)$$
then just put $t:=1$ to get
$$x\frac{\partial f}{\partial x}(x, y)+y\frac{\partial f}{\partial y}(x,y) = nf(x,y).$$
