I have an ancestor who was illegitimate and went by his mother’s name but when he married his father was listed under his own surname. From what I have been able to gather, he acknowledged the two sons (same mother) born out of wedlock, and in fact, the older son switched to his father’s surname in time. My lot continued on with the female line name.