This calculation applies to the statutory matrimonial property regime of community of accrued gains (marriage without a prenuptial agreement). It does not apply if you agreed separation of property (Gütertrennung).
Each person's assets on the date of marriage.Initial assets are the value of the assets (net of debts) at the time of marriage. They are deducted from the final assets to determine the gain. Negative initial assets are possible – here we simplify from 0.
Each person's assets on the date the divorce petition is served.Final assets are the value of the assets (net of debts) on the relevant date – usually the service of the divorce petition. The difference from the initial assets is the gain.