Ki Teitzei - Rishon
One Thing Leads to Another
When the Jews go to war and are victorious, it may happen that a soldier is smitten with a beautiful woman from among the captives and want to marry her. (Hey, it happens!) This is not completely prohibited, though it is discouraged, so there is a process that must be followed.
She must shave her head and let her fingernails grow. (Or cut her nails. Verse 12 just says "do to her nails," so it's a difference of opinion. See Talmud Yevamos 48a.) She must wear the clothes of a captive for a full month, during which time she will mourn for her parents. All this makes the woman considerably less attractive. If he still wants to marry her, she may convert so that they can wed. If he no longer desires her, she must be freed; he cannot sell her or keep her for a servant because of what he put her through.
Now let's say that a man has two wives, one he loves and one he's not so crazy about. And let's say that the first-born son is the son of the wife he's not so crazy about. He's not allowed to give the birthright share to the son of his favorite wife. His eldest son gets a double portion of the estate no matter who the mother is.
If a person has a thoroughly rotten son who absolutely will not toe the line, the parents may have him flogged in an attempt to rein him in. If he's completely incorrigible, he may even be put to death because his evil fate is inevitable. (To be eligible for this punishment, the boy must steal money from his father, use it to buy meat, which he must consume undercooked with a certain quantity of wine in front of his father's house with a circle of bad friends. There are a lot of other conditions, too. The Talmud in Sanhedrin 71a tells us that the case of the rebellious son never happened and was only included in the Torah for the lesson it imparts.)
Midrashically, the cases of the attractive captive, the despised wife and the rebellious son form a chain of events. The man ought not to marry the captive. If he does, he will ultimately come to hate her and they will have a stubborn and rebellious son (see Rashi on verse 11).
It's interesting to note that in verse 17, the word bachor is written chaseir (that is, lacking the letter vav normally there). Without the vav, bachor is spelled beis-chaf-reish. The numerical values of these letters are 2, 20 and 200, respectively. These are the only letters in the Hebrew alphabet that are twice the numerical value of the preceding letters (1, 10 and 100). This is symbolic of the first-born son's double portion.