Tym samym = tak samo
Tego samego = takiego samego
I'm not sure what do you mean here...
Oni wyglądają
tak samo - they look alike
Oni używają
takiego samego sprzętu - they use the same devices (the same = alike, similar devices,
almost the same)
Oni używają
tego samego sprzętu - they use the same devices (exactly the same! the same brand and kind. In some context it might mean also a one object used by two people. Compare:
- Używamy
takiej samej szczoteczki do zębów. Nie pomyl się. (there are two teethbrushes which look alike)
- Używamy
tej samej szczoteczki do zębów! O boże, umyłam zęby twoją szczoteczką! (there is one teethbrush used by two people)
In this sentence there is similar situation:
Oni myją się
tym samym mydłem - they use the same soap (two people share one soap or a soap of the same brand)
So you see there is significant difference! ;)