# Partial Derivative problem using Mathematica

**URL:** <https://community.wolfram.com/t/partial-derivative-problem-using-mathematica/7918>\
**Category:** Questions\
**Tags:** calculus\
**Created:** [February 16, 2016, 9:33pm UTC](https://community.wolfram.com/t/partial-derivative-problem-using-mathematica/7918 "2016-02-16T21:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eszmaty](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@eszmaty](https://community.wolfram.com/u/eszmaty)\
**Post date:** [February 16, 2016, 9:33pm UTC](https://community.wolfram.com/t/partial-derivative-problem-using-mathematica/7918/1 "2016-02-16T21:33:21Z")

</div>

Hi I am rather new to Mathematica and still learning how to use it (shifting from MathCad) and came across this rather simple problem: using partial derivative of a simple function f(x,y)=x\*y or x y with respect to y I should be getting x, but somehow Mathematica gives different solution:

```
In[5]:= G[x_, y_] := x y
D[G[x, y] y]

Out[6]= x y^2

```

Where is my problem?

Thanks

sorry seems like the editing needs to be done, I did say I am new to Mathematica anyway my problem in a simple txt form is:

```
In[5]:= G[x_,y_]:=x y

D[G[x,y]y]

Out[6]= x y^2

```

A screen shot of the syntax i used is attached as well.  
Hope this time the problem is better presented for your input.

Thanks

---

<div class="post-metadata">

**Author:** ![shenghuiy](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/shenghuiy/32/36073_2.png) [@shenghuiy](https://community.wolfram.com/u/shenghuiy)\
**Post date:** [February 17, 2016, 6:07am UTC](https://community.wolfram.com/t/partial-derivative-problem-using-mathematica/7918/2 "2016-02-17T06:07:13Z")

</div>

Use the following code example:

```
In[52]:= G[x_,y_]:=x y 
In[53]:= D[G[x,y], y]
Out[53]= x

```

---

<div class="post-metadata">

**Author:** ![eszmaty](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@eszmaty](https://community.wolfram.com/u/eszmaty)\
**Post date:** [February 18, 2016, 3:53am UTC](https://community.wolfram.com/t/partial-derivative-problem-using-mathematica/7918/3 "2016-02-18T03:53:11Z")

</div>

Yes, thanks Shenghui, it worked well, the , before y was missing which has changed the whole expression.  
Cheers,

Andrzej
