---
title: "Charge density and total charge from D"
subject: "Electromagnetism"
chapter: 2
key: "semester_3/electromagnetism:volume-charge-density-d-field-sphere"
source: https://www.bctengineer.com/q/semester_3/electromagnetism/volume-charge-density-d-field-sphere
site: BCT Engineering
---

# Charge density and total charge from D

Electromagnetism · Chapter 2: Electric field

- Asked in: 2075 Asoj, 2+2+2 marks
- Video: [Electrostatics - Example: Charge Density and Charge from D](https://www.youtube.com/watch?v=uvDn8wJw_Eo) — Daniel Cutshall - Milligan University
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/electromagnetism/volume-charge-density-d-field-sphere
- Whole chapter: https://www.bctengineer.com/md/semester_3/electromagnetism/chapter-2

## Question

Given the field D = [5 sin(θ) cos(φ)/r] a_r C/m², find: (a) the volume charge density; (b) the total charge contained in the region r < 2 m; (c) the value of D at the surface r = 2.

## Short answer

ρ_v = ∇·D = 5 sinθ cosφ / r² C/m³. Total charge Q = ∮ D·dS = 0 because the φ-integral of cosφ over 0 to 2π vanishes. At surface r=2, D = 2.5 sinθ cosφ a_r C/m².

## Answer

Given D = (5 sinθ cosφ / r) a_r C/m². Only D_r exists, and D_r depends on r, θ and φ. Use Gauss's law in differential form, ρ_v = ∇·D.

#### (a) Volume charge density
```text
∇·D = (1/r²) ∂(r² D_r)/∂r
    = (1/r²) ∂(5 r sinθ cosφ)/∂r
    = (1/r²)(5 sinθ cosφ)
ρ_v = 5 sinθ cosφ / r²   C/m³
```
(The other two terms of the divergence vanish because D_θ = D_φ = 0.)

#### (b) Total charge in r < 2 m
Using Gauss's law Q = ∮ D·dS over the sphere r = 2 (dS = r² sinθ dθ dφ a_r):

```text
Q = ∫₀²ᵖⁱ ∫₀ᵖⁱ (5 sinθ cosφ / 2)(4 sinθ) dθ dφ
  = 10 ∫₀ᵖⁱ sin²θ dθ · ∫₀²ᵖⁱ cosφ dφ
  = 10 (π/2)(0)
  = 0
```
Check with the volume integral: Q = ∫ρ_v dv = ∫∫∫ (5 sinθ cosφ/r²) r² sinθ dr dθ dφ. The φ-integral of cosφ over 0 to 2π is zero, so Q = 0. The positive charge for −π/2 < φ < π/2 is cancelled by equal negative charge elsewhere.

**Q = 0 C**

#### (c) D at r = 2
```text
D = 5 sinθ cosφ / 2  a_r = 2.5 sinθ cosφ a_r  C/m²
```

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which law gives the volume charge density from D?
   A. ρ_v = ∇ × D
   B. ρ_v = D/ε
   C. ρ_v = ∇V
   D. ρ_v = ∇ · D (Gauss's law, point form)
   Answer: D. Point form of Gauss's law is ∇·D = ρ_v. (Key point: Method for ρ_v)

2. With only D_r, the divergence is:
   A. ∂D_r/∂r only
   B. 5 sinθ cosφ / r
   C. (1/r²) ∂(r² D_r)/∂r, giving 5 sinθ cosφ / r²
   D. 0
   Answer: C. r²D_r = 5 r sinθ cosφ, derivative 5 sinθ cosφ, divided by r². (Key point: Divergence)

3. The total charge in r < 2 m is:
   A. 10 C
   B. 0, because the φ-integral of cosφ over 0 to 2π vanishes
   C. 5π C
   D. 20π C
   Answer: B. Positive and negative charge cancel since ∫cosφ dφ = 0. (Key point: Total charge)

4. At r = 2, D equals:
   A. 2.5 sinθ cosφ a_r C/m²
   B. 5 sinθ cosφ a_r
   C. 10 sinθ cosφ a_r
   D. 0
   Answer: A. D = 5 sinθ cosφ/2 a_r. (Key point: D at surface)

## Related in Electromagnetism

- [Total current through surface, H field](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Atotal-current-through-surface-h-rho) — Electromagnetism, chapter 3
- [Total current through conical surface](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acurrent-conical-surface-h-field) — Electromagnetism, chapter 3
- [Total current through z = 4 surface](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acurrent-through-z-4-surface) — Electromagnetism, chapter 3
- [Coaxial cable charge density, D and E](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acoax-cable-charge-density-d-e) — Electromagnetism, chapter 2
- [Average J over surface and ∂ρv/∂t](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Aaverage-j-charge-rate-change) — Electromagnetism, chapter 2
- [Energy density in electrostatic field](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Aenergy-density-electrostatic-field) — Electromagnetism, chapter 2, asked 2×

## Related in other subjects

- [Volume or surface area of cycloid about base](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Avolume-or-surface-cycloid-base) — Mathematics I, chapter 2
- [Volume integral over a region F=2xzi−xj+y²k](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Avolume-integral-over-a-region-f) — Mathematics III, chapter 2
- [Volume of cardioid r=a(1+cosθ) about initial line](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Avolume-cardioid-1-plus-cos-initial-line) — Mathematics I, chapter 2, asked 6×
- [Volume of cardioid r=a(1−cosθ) about initial line](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Avolume-cardioid-1-minus-cos) — Mathematics I, chapter 2, asked 6×
