# Finding charge density

ajith.mk91

## Homework Statement

There is a beam of electrons in the space starting at x=0 and ending at x=20cm. The cross section of the beam is A.The velocity of the electrons is a function of position x and let it be v(x).Now i need to calculate the volume charge density as a function of x.

## The Attempt at a Solution

What i did is this:
I took an imaginary plane perpendicular to the beam.In a small time interval dt the amount of charge crossing the plane of area A is J.So dividing this J with v(x) should give the density. But J is not specified.Is there any other way to solve this?

Staff Emeritus
Homework Helper
I don't think there's enough information to solve the problem. Was that the complete problem as given to you?

ajith.mk91
The question has an additional info which i did not mention in my previous post.The current density is given at x=20cm as 10000A/m2(Actually a cathode is placed at x=0 and an anode is placed at x=20cm).But i was asked to find both the volume charge density and current density as a function of x.

Staff Emeritus
$$\nabla\cdot\vec{J}+\frac{\partial\rho}{\partial t} = 0$$