How to obtain the convolution of these functions?

I am starting to use Mathematica. I wanted to compute $$\nabla F*\phi(x),\;x\in\mathbb{R^2}$$ where $$F(x)=\ln\|x\|$$ and $$\phi(x)=\chi_{B(0,2)}(x)$$.

I am a new user of this software, so I don't know advanced commands yet. The code that I have used is:

F[x_, y_] = 1/2*Log[x^2 + y^2];
g[x_, y_] = Piecewise[{{1, x^2 + y^2 <= r}, {0, True}}]
C[z1_, z2_] = Convolve[Grad[F[x, y], {x, y}], g[x, y]


The problem is that this doesn't return any value after two hours of computation. Could someone tell me how can I solve this?

EDIT: I add some information about what I want to do, expecting that this can help to get a way to make this convolution.

After that I will need to compute the integral of the product of $$C$$ and certain function. Concretely, I want to compute the following line integral over the border of the disk $$D(0,2)$$

$$\int_{C(0,2)}F*g(x)\nabla F *g(x)\cdot n(x),$$ where $$n$$ denotes the normal vector. The only way that I know to compute this is:

    F[x_, y_] = 1/2*Log[x^2 + y^2];
g[x_, y_] = Piecewise[{{1, x^2 + y^2 <= r}, {0, True}}]
C[z1_, z2_] = Convolve[Grad[F[x, y], {x, y}], g[x, y]
C1[z1_, z2_] = Convolve[F[x, y], g[x, y], {x, y}, {z1, z2}]
NIntegrate[ C1[r*Cos[s], r*Sin[s]]* Dot[C[r*Cos[s], r*Sin[s]], {r*Cos[s], r*Sin[s]}]  , {s, 0, 2*Pi}]

• A big edit to the question should be described. Feb 27, 2022 at 16:02
• Sorry, it is my first question here. I hope it is better now Feb 27, 2022 at 16:05
• Please, indicate the substantial change you made in the question. Feb 27, 2022 at 16:10
• Done! Sorry. I hope this helps to get an answer to my question Feb 27, 2022 at 16:20
• 1. The functions $w,n$ and the integral $$\int_{C(0,2)}F*w(x)\nabla F *w(x)\cdot n(x)$$ are not defined. 2. Ask a separate question instead of your edit. Feb 27, 2022 at 16:23

First, the convolution is defined for functions, but Grad[F[x, y], {x, y}] is a vector. Second,

F[x_, y_] := 1/2*Log[x^2 + y^2];
g[x_, y_,r_] := Piecewise[{{1, x^2 + y^2 <= r}, {0, True}}];
Convolve[Grad[F[x, y], {x, y}][[1]], g[x, y,r], {x, y}, {z1, z2},
Assumptions -> r > 0]


returns the input. Therefore, the convolution should be realized numerically, making use of its definition:

c[r_?NumericQ, z1_?NumericQ, z2_?NumericQ] :=
NIntegrate[Grad[F[x, y], {x, y}][[1]]*g[x - z1, y - z2,r], {x, -Infinity,
Infinity}, {y, -Infinity, Infinity},AccuracyGoal -> 4, PrecisionGoal -> 4,
c[2, 2, -1]


2.2144

c[r_?NumericQ, z1_?NumericQ, z2_?NumericQ] :=

We see NIntegrate leaves much to be desired.
• Thanks for your answer. I understand the convolution of a vector and a a function as: $(F_1,F_2)*f=(F_1*f,F_2*f)$. I edit the question to clarify what I want to do. Feb 27, 2022 at 15:31
• x^2 + y^2 <= r should be x^2 + y^2 <= r^2. g[x - z1, y - z2] should be g[x - z1, y - z2,r]. Feb 27, 2022 at 16:12
• @cvgmt: Thank you. I followed the notation of the question. The typo in g is fixed. Feb 27, 2022 at 16:16