Sexual differentiation in humans

Sexual differentiation in humans is the process of development of sex differences in humans. It is defined as the development of phenotypic structures consequent to the action of hormones produced following gonadal determination. Sexual differentiation includes development of different genitalia and the internal genital tracts and body hair plays a role in gender identification.
The development of sexual differences begins with the XY sex-determination system that is present in humans, and complex mechanisms are responsible for the development of the phenotypic differences between male and female humans from an undifferentiated zygote. Females typically have two X chromosomes, and males typically have a Y chromosome and an X chromosome. At an early stage in embryonic development, both sexes possess equivalent internal structures. These are the mesonephric ducts and paramesonephric ducts. The presence of the SRY gene on the Y chromosome causes the development of the testes in males, and the subsequent release of hormones which cause the paramesonephric ducts to regress. In females, the mesonephric ducts regress.
Divergent sexual development, known as intersex, can be a result of genetic and hormonal factors.
Sex determination.
Most mammals, including humans, have an XY sex-determination system: the Y chromosome carries factors responsible for triggering male development. In the absence of a Y chromosome, the fetus will undergo female development. This is because of the presence of the sex-determining region of the Y chromosome, also known as the SRY gene. Thus, male mammals typically have an X and a Y chromosome (XY), while female mammals typically have two X chromosomes (XX).
Chromosomal sex is determined at the time of fertilization; a chromosome from the sperm cell, either X or Y, fuses with the X chromosome in the egg cell. "Gonadal sex" refers to the gonads, that is the testis or ovaries, depending on which genes are expressed. "Phenotypic sex" refers to the structures of the external and internal genitalia. 
A human fetus does not develop its external sexual organs until seven weeks after fertilization. The fetus appears to be sexually indifferent, looking neither like a male or a female. Over the next five weeks, the fetus begins producing hormones that cause its sex organs to grow into either male or female organs. This process is called sexual differentiation. The precursor of the internal female sex organs is called the Müllerian system.
Reproductive system.
By 7 weeks, a fetus has a genital tubercle, urogenital groove and sinus, and labioscrotal folds. In females, without excess androgens, these become the clitoris, urethra and vagina, and labia
Differentiation between the sexes of the sex organs occurs throughout embryological, fetal and later life. This includes both internal and external genital differentiation. In both males and females, the sex organs consist of three structures: the gonads, the internal genitalia, and the external genitalia. In males, the gonads are the testes and in females they are the ovaries. These are the organs that produce gametes (egg and sperm), the reproductive cells that will eventually meet to form the fertilized egg (zygote).
As the zygote divides, it first becomes the embryo (which means 'growing within'), typically between zero and eight weeks, then from the eighth week until birth, it is considered the fetus (which means 'unborn offspring'). The internal genitalia are all the accessory glands and ducts that connect the gonads to the outside environment. The external genitalia consist of all the external reproductive structures. The sex of an early embryo cannot be determined because the reproductive structures do not differentiate until the seventh week. Prior to this, the child is considered bipotential because it cannot be identified as male or female.
Internal genital differentiation.
The internal genitalia consist of two accessory ducts: mesonephric ducts (male) and paramesonephric ducts (female). The mesonephric system is the precursor to the male genitalia and the paramesonephric to the female reproductive system. As development proceeds, one of the pairs of ducts develops while the other regresses. This depends on the presence or absence of the sex determining region of the Y chromosome, also known as the SRY gene. In the presence of a functional SRY gene, the bipotential gonads develop into testes. Gonads are histologically distinguishable by 6–8 weeks of gestation.
Subsequent development of one set and degeneration of the other depends on the presence or absence of two testicular hormones: testosterone and anti-müllerian hormone (AMH). Disruption of typical development may result in the development of both, or neither, duct system, which may produce morphologically intersex individuals.
Males: The SRY gene when transcribed and processed produces SRY protein that binds to DNA and directs the development of the gonad into testes. Male development can only occur when the fetal testis secretes key hormones at a critical period in early gestation. The testes begin to secrete three hormones that influence the male internal and external genitalia: they secrete anti-müllerian hormone (AMH), testosterone, and dihydrotestosterone (DHT). Anti-müllerian hormone causes the paramesonephric ducts to regress. Testosterone converts the mesonephric ducts into male accessory structures, including the epididymis, vas deferens, and seminal vesicle. Testosterone will also control the descending of the testes from the abdomen into the scrotum. Many other genes found on other autosomes, including "WT1", "SOX9" and "SF1" also play a role in gonadal development.
Females: Without testosterone and AMH, the mesonephric ducts degenerate and disappear. The paramesonephric ducts develop into a uterus, fallopian tubes, and upper vagina. There still remains a broad lack of information about the genetic controls of female development, and much remains unknown about the female embryonic process.
External genital differentiation.
Males become externally distinct between 8 and 12 weeks, as androgens enlarge the phallus and cause the urogenital groove and sinus to fuse in the midline, producing an unambiguous penis with a phallic urethra, and a thinned, rugated scrotum. Dihydrotestosterone will differentiate the remaining male characteristics of the external genitalia.
A sufficient amount of any androgen can cause external masculinization. The most potent is dihydrotestosterone (DHT), generated from testosterone in skin and genital tissue by the action of 5α-reductase. A male fetus may be incompletely masculinized if this enzyme is deficient. In some diseases and circumstances, other androgens may be present in high enough concentrations to cause partial or (rarely) complete masculinization of the external genitalia of a genetically female fetus. The testes begin to secrete three hormones that influence the male internal and external genitalia. They secrete anti-müllerian hormone, testosterone, and Dihydrotestosterone. Anti-Müllerian hormone (AMH) causes the paramesonephric ducts to regress. Testosterone, which is secreted and converts the mesonephric ducts into male accessory structures, such as epididymis, vas deferens and seminal vesicle. Testosterone will also control the descending of the testes from the abdomen into the scrotom. Dihydrotestosterone, also known as (DHT) will differentiate the remaining male characteristics of the external genitalia.
Further sex differentiation of the external genitalia occurs at puberty, when androgen levels again become disparate. Male levels of testosterone directly induce growth of the penis, and indirectly (via DHT) the prostate.
Alfred Jost observed that while testosterone was required for mesonephric duct development, the regression of the paramesonephric duct was due to another substance. This was later determined to be paramesonephric inhibiting substance (MIS), a 140 kD dimeric glycoprotein that is produced by sertoli cells. MIS blocks the development of paramesonephric ducts, promoting their regression.
Secondary sexual characteristics.
Breast.
Visible differentiation occurs at puberty, when estradiol and other hormones cause breasts to develop in typical females.
Psychological and behavioral differentiation.
Human adults and children show many psychological and behavioral sex differences. Some (e.g. dress) are learned and obviously cultural. Others are demonstrable across cultures and have both biological and learned determinants. For example, some studies claim girls are, on average, more verbally fluent than boys, but boys are, on average, better at spatial calculation. Some have observed that this may be due to two different patterns in parental communication with infants, noting that parents are more likely to talk to girls and more likely to engage in physical play with boys. Because people cannot explore hormonal influences on human behavior experimentally, the relative contributions of biological factors and learning to human psychological and behavioral sex differences (especially gender identity, role, and sexual orientation) are controversial (and hotly contested).
Current theories on mechanisms of sexual differentiation of brains and behavior in humans are based primarily on three sources of evidence: animal research involving manipulation of hormones in early life, observation of outcomes of small numbers of individuals with intersex conditions or cases of early sex reassignment, and statistical distribution of traits in populations (e.g., rates of homosexuality in twins). Many of these cases suggest some genetic or hormonal effect on sex differentiation of behavior and mental traits. This has been disputed as poor interpretation of scientific methodology.
Intersex variations.
The following are some of the variations associated with atypical determination and differentiation process: