def add_dict(dict1, dict2):
    """
    Add two dictionaries together.

    Parameters
    ----------
    dict1 : dict
        First dictionary to add.
    dict2 : dict
        Second dictionary to add.
    
    Returns
    -------
    dict
        The sum of the two dictionaries.
    
    Examples
    --------
    >>> add_dict({1: 2, 3: 4}, {1: 3, 5: 6})
    {1: 5, 3: 4, 5: 6}
    """
    # Need to copy dictionaries to prevent changing der for original variables
    dict1 = dict(dict1)
    dict2 = dict(dict2)
    for key in dict2:
        if key in dict1:
            dict2[key] = dict2[key] + dict1[key]
    return {**dict1, **dict2}