
teilnehmen an
to participate in
To be present at and take part in an event, course, competition, or activity.
Nächstes Jahr möchte ich am Stadtmarathon teilnehmen.
Next year I would like to participate in the city marathon.
to participate / sympathize
Loading your saved state.

to participate in
To be present at and take part in an event, course, competition, or activity.
Nächstes Jahr möchte ich am Stadtmarathon teilnehmen.
Next year I would like to participate in the city marathon.

to sympathize with
To show sympathy or share in another person's fate or feelings, especially in grief.
Wir nehmen aufrichtig an Ihrem schweren Verlust teil.
We sincerely sympathize with you in your heavy loss.
'Teilnehmen' (to participate / sympathize) is a separable verb. In a main clause, the prefix 'teil' stands at the end of the sentence. In subordinate clauses and infinitive constructions, the verb stays together.
Er nimmt regelmäßig an den Treffen teil.
He regularly participates in the meetings.
'Teilnehmen' (to participate / sympathize) is always used with the preposition 'an' and the dative. You take part 'an etwas' (in something) or 'an jemandem' (with someone/in someone's situation).
Sie hat an einem interessanten Workshop teilgenommen.
She participated in an interesting workshop.
The verb is made up of 'Teil' (part) and 'nehmen' (to take). Literally, it means 'to take a part of something,' which explains the idea of participation well.
Über hundert Läufer nehmen am Marathon teil.
Over a hundred runners are participating in the marathon.
The meaning 'Mitgefühl zeigen' (to show sympathy) is formal and is used almost exclusively in the context of grief and condolences, often in written form.
Wir nehmen aufrichtig an Ihrem schweren Verlust teil.
We sincerely sympathize with you in your heavy loss.
to participate / involve
Both words can be used for a shared event or activity. „Teilnehmen“ can also mean simply being present and joining in, while „sich beteiligen“ places more emphasis on active involvement. Use „teilnehmen“ for mere attendance and „sich beteiligen“ when someone contributes something themselves.

Mia nahm an der Diskussion teil und hörte nur zu.
Mia attended the discussion and only listened.
Mia beteiligte sich an der Diskussion und stellte mehrere Fragen.
Mia took part in the discussion and asked several questions.